]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: light: acpi-als: Convert ACPI driver to a platform one
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 4 Mar 2026 18:33:14 +0000 (19:33 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 14 Mar 2026 12:10:21 +0000 (12:10 +0000)
commitd4243cb08a272b6cc0f7c8293f9c7e128b51795c
treeb7125a8f3b7997468f2f5671a57a351b0ff9f2b4
parent1653e0897f1526acfb6d041d4920ebc6a3c3b028
iio: light: acpi-als: Convert ACPI driver to a platform one

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].

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

After this change, the subordinate IIO device will be registered under
the platform device used for driver binding instead of its ACPI
companion.

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

Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/acpi-als.c