Re: [PATCH v2 2/3] drivers: hwmon: Add W83773G driver

From: Guenter Roeck
Date: Wed Nov 08 2017 - 12:59:21 EST


On Wed, Nov 08, 2017 at 02:03:34PM +0800, Lei YU wrote:
> On Tue, Nov 7, 2017 at 10:33 PM, Guenter Roeck <linux@xxxxxxxxxxxx> wrote:
> > On 11/07/2017 12:27 AM, Lei YU wrote:
> >>
> >> Nuvoton W83773G is a hardware monitor IC providing one local
> >> temperature and two remote temperature sensors.
> >>
> >> Signed-off-by: Lei YU <mine260309@xxxxxxxxx>
> >> ---
> >> v2:
> >> - Rewrite the driver using regmap
> >> - Add offset and update_interval
[ ... ]

> >> + hwmon_dev = devm_hwmon_device_register_with_groups(dev,
> >> client->name,
> >> + regmap,
> >> w83773g_groups);
> >
> >
> > You lost me here. Why did you stop using the new API ?
>
> I was referencing some other hwmon driver (e.g. tmp401.c) and find out
> the usage of SENSOR_DEVICE_ATTR, which I feel more clear and straightforward.
>

The new API is supposed to replace the old API to make it independent from
sysfs and to simplify the actual driver code. On a driver like this, using
the new API should reduce code and data size by 30% or more.

If you find the new API to be less clear and less straigtforward to use than
the old API, we need to improve it. Do you have any suggestions ?

Thanks,
Guenter