]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
watchdog: ni903x_wdt: Convert to a platform driver
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 14 Mar 2026 11:53:01 +0000 (12:53 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 7 Apr 2026 19:06:59 +0000 (21:06 +0200)
commitd37ec2fbab55d732aae48ef2c877fb2d5ab08cd7
tree35fff30ec10c8d0b704790e8482c281f1c868eff
parent112b2f978afee7df725cda74a94802f919c61564
watchdog: ni903x_wdt: Convert to a platform driver

In all cases in which a struct acpi_driver is used for binding a driver
to an ACPI device object, a corresponding platform device is created by
the ACPI core and that device is regarded as a proper representation of
underlying hardware.  Accordingly, a struct platform_driver should be
used by driver code to bind to that device.  There are multiple reasons
why drivers should not bind directly to ACPI device objects [1].

In particular, registering a watchdog device under a struct acpi_device
is questionable because it causes the watchdog to be hidden in the ACPI
bus sysfs hierarchy and it goes against the general rule that a struct
acpi_device can only be a parent of another struct acpi_device.

Overall, it is better to bind drivers to platform devices than to their
ACPI companions, so convert the ni903x_wdt watchdog ACPI driver to a
platform one.

While this is not expected to alter functionality, it changes sysfs
layout and so it will be visible to user space.

Note that after this change it actually makes sense to look for
the "timeout-sec" property via device_property_read_u32() under the
device passed to watchdog_init_timeout() because it has an fwnode
handle (unlike a struct acpi_device which is an fwnode itself).

Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://patch.msgid.link/13996583.uLZWGnKmhe@rafael.j.wysocki
drivers/watchdog/ni903x_wdt.c