Re: [PATCH] hwmon: Include <linux/kstrtox.h> when appropriate

From: Guenter Roeck
Date: Sun Nov 06 2022 - 12:22:32 EST


On Sun, Nov 06, 2022 at 11:31:27AM +0100, Christophe JAILLET wrote:
> The kstrto<something>() functions have been moved from kernel.h to
> kstrtox.h.
>
> So, include the latter directly in the appropriate files.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> ---
> The goal of this patch is to eventually remove <linux/kernel.h> from
> <linux/watchdog.h>.
>
> This patch is needed to avoid indirect inclusion, via <linux/watchdog.h>,
> in fschmd.c, ftsteutates.c and w83793.c.
>
>
> Maybe, just including <linux/kstrtox.h> in <linux/hwmon.h> would also do
> the job. It is likely that this file is included in all hwmon's drivers.
> Let me know if this less intrusive approach is preferred.

Include it from <linux/hwmon-sysfs.h>. This should cover almost all
drivers needing it. The remaining drivers (if there are any) should
include it directly. Almost all drivers registering the hwmon device
with [devm_]hwmon_device_register_with_info() do not need the include,
but (almost) all drivers registering with an older API will need it.
Those drivers will also include <linux/hwmon-sysfs.h>.

Thanks,
Guenter