From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Linux ACPI" <linux-acpi@vger.kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v1 2/2] iio: light: acpi-als: Convert ACPI driver to a platform one
Date: Sat, 7 Mar 2026 12:20:03 +0000 [thread overview]
Message-ID: <20260307122003.691e2478@jic23-huawei> (raw)
In-Reply-To: <aakseadAuKEMAmvq@ashevche-desk.local>
On Thu, 5 Mar 2026 09:10:49 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> On Wed, Mar 04, 2026 at 07:33:14PM +0100, Rafael J. Wysocki wrote:
> > From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> >
> > 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.
>
> ...
>
> > -static struct acpi_driver acpi_als_driver = {
> > - .name = "acpi_als",
> > - .class = ACPI_ALS_CLASS,
> > - .ids = acpi_als_device_ids,
> > - .ops = {
> > - .add = acpi_als_add,
> > - .remove = acpi_als_remove,
> > +static struct platform_driver acpi_als_driver = {
> > + .probe = acpi_als_probe,
> > + .remove = acpi_als_remove,
> > + .driver = {
> > + .name = "acpi_als",
> > + .acpi_match_table = acpi_als_device_ids,
> > },
> > };
>
> >
>
> You can also drop this unneeded blank line.
>
> > -module_acpi_driver(acpi_als_driver);
> > +module_platform_driver(acpi_als_driver);
>
> Anyways, LGTM,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tweaked and applied to the testing branch of iio.git.
Thanks,
Jonathan
>
prev parent reply other threads:[~2026-03-07 12:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 18:31 [PATCH v1 0/2] iio: light: acpi-als: Use platform device for driver binding Rafael J. Wysocki
2026-03-04 18:32 ` [PATCH v1 1/2] iio: light: acpi-als: Register ACPI notify handler directly Rafael J. Wysocki
2026-03-05 7:11 ` Andy Shevchenko
2026-03-04 18:33 ` [PATCH v1 2/2] iio: light: acpi-als: Convert ACPI driver to a platform one Rafael J. Wysocki
2026-03-05 7:10 ` Andy Shevchenko
2026-03-07 12:20 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260307122003.691e2478@jic23-huawei \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox