mbox series

[v2,0/2] gpiolib: Align prototypes of *gpio_count() APIs

Message ID 20240229145303.3801332-1-andriy.shevchenko@linux.intel.com (mailing list archive)
Headers show
Series gpiolib: Align prototypes of *gpio_count() APIs | expand

Message

Andy Shevchenko Feb. 29, 2024, 2:51 p.m. UTC
Two out of three GPIO count APIs take device pointer. OF case clearly
does not need it as it immediately switches to device node inside, and
ACPI abstracts that to struct acpi_device pointer. Unify all these by
making them to take struct fwnode_handle pointer. This, in particular,
will allow to create fwnode_gpio_count() API if needed. The need of that
was discussed here [1].

Note, no functional changes intended.

Link: https://lore.kernel.org/r/2ad735ed-963c-4e75-b83e-687ea2c0aef5@alliedtelesis.co.nz [1]

In v2:
- fixed typo (Chris)
- added tag (Linus)

Andy Shevchenko (2):
  gpiolib-of: Make of_gpio_get_count() take firmware node as a parameter
  gpiolib-acpi: Make acpi_gpio_count() take firmware node as a parameter

 drivers/gpio/gpiolib-acpi.c | 13 ++++++-------
 drivers/gpio/gpiolib-acpi.h |  4 ++--
 drivers/gpio/gpiolib-of.c   | 13 ++++++-------
 drivers/gpio/gpiolib-of.h   |  5 +++--
 drivers/gpio/gpiolib.c      |  4 ++--
 5 files changed, 19 insertions(+), 20 deletions(-)

Comments

Mika Westerberg March 1, 2024, 6:43 a.m. UTC | #1
On Thu, Feb 29, 2024 at 04:51:37PM +0200, Andy Shevchenko wrote:
> Two out of three GPIO count APIs take device pointer. OF case clearly
> does not need it as it immediately switches to device node inside, and
> ACPI abstracts that to struct acpi_device pointer. Unify all these by
> making them to take struct fwnode_handle pointer. This, in particular,
> will allow to create fwnode_gpio_count() API if needed. The need of that
> was discussed here [1].
> 
> Note, no functional changes intended.
> 
> Link: https://lore.kernel.org/r/2ad735ed-963c-4e75-b83e-687ea2c0aef5@alliedtelesis.co.nz [1]
> 
> In v2:
> - fixed typo (Chris)
> - added tag (Linus)
> 
> Andy Shevchenko (2):
>   gpiolib-of: Make of_gpio_get_count() take firmware node as a parameter
>   gpiolib-acpi: Make acpi_gpio_count() take firmware node as a parameter

For both,

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Bartosz Golaszewski March 1, 2024, 8:09 a.m. UTC | #2
On Thu, Feb 29, 2024 at 3:53 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Two out of three GPIO count APIs take device pointer. OF case clearly
> does not need it as it immediately switches to device node inside, and
> ACPI abstracts that to struct acpi_device pointer. Unify all these by
> making them to take struct fwnode_handle pointer. This, in particular,
> will allow to create fwnode_gpio_count() API if needed. The need of that
> was discussed here [1].
>
> Note, no functional changes intended.
>
> Link: https://lore.kernel.org/r/2ad735ed-963c-4e75-b83e-687ea2c0aef5@alliedtelesis.co.nz [1]
>
> In v2:
> - fixed typo (Chris)
> - added tag (Linus)
>
> Andy Shevchenko (2):
>   gpiolib-of: Make of_gpio_get_count() take firmware node as a parameter
>   gpiolib-acpi: Make acpi_gpio_count() take firmware node as a parameter
>
>  drivers/gpio/gpiolib-acpi.c | 13 ++++++-------
>  drivers/gpio/gpiolib-acpi.h |  4 ++--
>  drivers/gpio/gpiolib-of.c   | 13 ++++++-------
>  drivers/gpio/gpiolib-of.h   |  5 +++--
>  drivers/gpio/gpiolib.c      |  4 ++--
>  5 files changed, 19 insertions(+), 20 deletions(-)
>
> --
> 2.43.0.rc1.1.gbec44491f096
>

Series applied.

Bart