[v3,0/3] device property: Introduce device_is_compatible()

Message ID 20230612161011.86871-1-andriy.shevchenko@linux.intel.com
Headers
Series device property: Introduce device_is_compatible() |

Message

Andy Shevchenko June 12, 2023, 4:10 p.m. UTC
  Introduce a new helper to tell if device (node) is compatible to the
given string value. This will help some drivers to get rid of unneeded
OF APIs/etc and in may help others to be agnostic to OF/ACPI.

While doing it, I have noticed that ACPI_DEVICE_CLASS() macro seems
defined in unsuitable location. Move it to the better one.

Last patch is an example of what the first two are doing.

The entire series can go, I believe, via ACPI (linux-pm) tree in case
the last patch gets tag from the respective maintainer.

In v3:
- added tag to patch 1 (Rafael), patches 2&3 (Sakari)
- made commit message text wider in patch 3 (Sakari)

In v2:
- updated commit message and added kernel doc for a new API (Greg)
- also replaced acpi_device_get_match_data() with the agnostic API
- tried to keep header inclusions ordered (to some extent)

Andy Shevchenko (3):
  ACPI: Move ACPI_DEVICE_CLASS() to mod_devicetable.h
  device property: Implement device_is_compatible()
  ata: ahci_platform: Make code agnostic to OF/ACPI

 drivers/ata/ahci_platform.c     |  8 ++++----
 include/linux/acpi.h            | 14 --------------
 include/linux/mod_devicetable.h | 13 +++++++++++++
 include/linux/property.h        | 12 ++++++++++++
 4 files changed, 29 insertions(+), 18 deletions(-)
  

Comments

Rafael J. Wysocki June 16, 2023, 5:55 p.m. UTC | #1
On Mon, Jun 12, 2023 at 6:12 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Introduce a new helper to tell if device (node) is compatible to the
> given string value. This will help some drivers to get rid of unneeded
> OF APIs/etc and in may help others to be agnostic to OF/ACPI.
>
> While doing it, I have noticed that ACPI_DEVICE_CLASS() macro seems
> defined in unsuitable location. Move it to the better one.
>
> Last patch is an example of what the first two are doing.
>
> The entire series can go, I believe, via ACPI (linux-pm) tree in case
> the last patch gets tag from the respective maintainer.
>
> In v3:
> - added tag to patch 1 (Rafael), patches 2&3 (Sakari)
> - made commit message text wider in patch 3 (Sakari)
>
> In v2:
> - updated commit message and added kernel doc for a new API (Greg)
> - also replaced acpi_device_get_match_data() with the agnostic API
> - tried to keep header inclusions ordered (to some extent)
>
> Andy Shevchenko (3):
>   ACPI: Move ACPI_DEVICE_CLASS() to mod_devicetable.h
>   device property: Implement device_is_compatible()
>   ata: ahci_platform: Make code agnostic to OF/ACPI
>
>  drivers/ata/ahci_platform.c     |  8 ++++----
>  include/linux/acpi.h            | 14 --------------
>  include/linux/mod_devicetable.h | 13 +++++++++++++
>  include/linux/property.h        | 12 ++++++++++++
>  4 files changed, 29 insertions(+), 18 deletions(-)
>
> --

All applied as 6.5 material, thanks!
  
Rafael J. Wysocki June 16, 2023, 7:07 p.m. UTC | #2
On Fri, Jun 16, 2023 at 7:55 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Mon, Jun 12, 2023 at 6:12 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > Introduce a new helper to tell if device (node) is compatible to the
> > given string value. This will help some drivers to get rid of unneeded
> > OF APIs/etc and in may help others to be agnostic to OF/ACPI.
> >
> > While doing it, I have noticed that ACPI_DEVICE_CLASS() macro seems
> > defined in unsuitable location. Move it to the better one.
> >
> > Last patch is an example of what the first two are doing.
> >
> > The entire series can go, I believe, via ACPI (linux-pm) tree in case
> > the last patch gets tag from the respective maintainer.
> >
> > In v3:
> > - added tag to patch 1 (Rafael), patches 2&3 (Sakari)
> > - made commit message text wider in patch 3 (Sakari)
> >
> > In v2:
> > - updated commit message and added kernel doc for a new API (Greg)
> > - also replaced acpi_device_get_match_data() with the agnostic API
> > - tried to keep header inclusions ordered (to some extent)
> >
> > Andy Shevchenko (3):
> >   ACPI: Move ACPI_DEVICE_CLASS() to mod_devicetable.h
> >   device property: Implement device_is_compatible()
> >   ata: ahci_platform: Make code agnostic to OF/ACPI
> >
> >  drivers/ata/ahci_platform.c     |  8 ++++----
> >  include/linux/acpi.h            | 14 --------------
> >  include/linux/mod_devicetable.h | 13 +++++++++++++
> >  include/linux/property.h        | 12 ++++++++++++
> >  4 files changed, 29 insertions(+), 18 deletions(-)
> >
> > --
>
> All applied as 6.5 material, thanks!

But I see that Greg has taken it too, so I'll drop it.
  
Andy Shevchenko June 19, 2023, 10:51 a.m. UTC | #3
On Fri, Jun 16, 2023 at 09:07:06PM +0200, Rafael J. Wysocki wrote:
> On Fri, Jun 16, 2023 at 7:55 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
> > On Mon, Jun 12, 2023 at 6:12 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:

> > > --
> >
> > All applied as 6.5 material, thanks!
> 
> But I see that Greg has taken it too, so I'll drop it.

Yep, thank you, guys!