[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b9ee331670fd40e69796dd428a844562842cdff3.camel@intel.com>
Date: Fri, 13 May 2022 19:33:27 +0800
From: Zhang Rui <rui.zhang@...el.com>
To: LABBE Corentin <clabbe@...libre.com>,
Guenter Roeck <linux@...ck-us.net>
Cc: jdelvare@...e.com, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/2] hwmon: acpi_power_meter: convert to
hwmon_device_register_with_info
On Fri, 2022-05-13 at 10:02 +0200, LABBE Corentin wrote:
> Le Wed, May 11, 2022 at 07:10:29PM -0700, Guenter Roeck a écrit :
> > Corentin,
> >
> > On 5/8/22 23:30, Corentin Labbe wrote:
> > > Booting lead to a hwmon_device_register() is deprecated. Please
> > > convert the driver to use hwmon_device_register_with_info().
> > > So let's convert the driver to use
> > > hwmon_device_register_with_info().
> > >
> > > Signed-off-by: Corentin Labbe <clabbe@...libre.com>
> > > ---
> >
> > [ ... ]
> >
> > > @@ -836,20 +740,20 @@ static void acpi_power_meter_notify(struct
> > > acpi_device *device, u32 event)
> > > if (res)
> > > break;
> > >
> > > - remove_attrs(resource);
> > > + remove_domain_devices(resource);
> > > setup_attrs(resource);
> >
> > Zhang Rui found an interesting problem with this code:
> > It needs a call to sysfs_update_groups(hwmon_dev->groups)
> > to update sysfs attribute visibility, probably between
> > remove_domain_devices() and setup_attrs().
> >
> > > break;
> > > case METER_NOTIFY_TRIP:
> > > - sysfs_notify(&device->dev.kobj, NULL,
> > > POWER_AVERAGE_NAME);
> > > + hwmon_notify_event(&device->dev, hwmon_power,
> > > hwmon_power_average, 0);
> >
> > ... which makes realize: The notification device should be the
> > hwmon device.
> > That would be resource->hwmon_dev, not the acpi device.
> >
>
> Hello
>
> I will fix this, but do you have an example how to test thoses code
> path easily ?
No, I don't have one.
-rui
Powered by blists - more mailing lists