Re: [PATCH v1 3/8] platform/mellanox: mlxreg-hotplug: Add hotplug hwmon uevent notification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 08, 2018 at 02:31:59PM +0000, Vadim Pasternak wrote:
> Notify user when hotplug device signal is received in order to allow user
> to handle such case, if it wishes to take some action on this matter.
> 
> Signed-off-by: Vadim Pasternak <vadimp@xxxxxxxxxxxx>
> ---
>  drivers/platform/mellanox/mlxreg-hotplug.c | 29 ++++++++++++++++++++---------
>  1 file changed, 20 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c b/drivers/platform/mellanox/mlxreg-hotplug.c
> index f32637e..4761211 100644
> --- a/drivers/platform/mellanox/mlxreg-hotplug.c
> +++ b/drivers/platform/mellanox/mlxreg-hotplug.c
> @@ -68,6 +68,7 @@
>   * @dwork_irq: delayed work template;
>   * @lock: spin lock;
>   * @hwmon: hwmon device;
> + * @kobj: hwmon kobject for notification;

What is the reason for adding the kobj to the priv struct when it is
only assigned to hwmon->kobj and the probe fails if we fail to register
the hwmon?

It's only used in two location below, which appear could just be:
priv->hwmon->kobj.

I'm not seeing any need for it to ever be anything different. If not,
let's keep the struct/field/data hierarchy and relationships explicit by
dereferencing hwmon.

-- 
Darren Hart
VMware Open Source Technology Center



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux