mbox series

[RFC,v2,0/6] ARM: pxa: GPIO descriptor conversions

Message ID 20230926-pxa-gpio-v2-0-984464d165dd@skole.hr
Headers show
Series ARM: pxa: GPIO descriptor conversions | expand

Message

Duje Mihanović Sept. 26, 2023, 3:46 p.m. UTC
Hello,

Small series to convert some of the board files in the mach-pxa directory
to use the new GPIO descriptor interface.

Most notably, the am200epd, am300epd and Spitz matrix keypad among
others are not converted in this series.

Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
---
Changes in v2:
- Address maintainer comments:
  - Change mentions of function to function()
  - Drop cast in OHCI driver dev_warn() call
  - Use %pe in OHCI and reset drivers
  - Use GPIO _optional() API in OHCI driver
  - Drop unnecessary not-null check in OHCI driver
  - Use pr_err() instead of printk() in reset driver
- Rebase on v6.6-rc3
- Link to v1: https://lore.kernel.org/r/20230924-pxa-gpio-v1-0-2805b87d8894@skole.hr

---
Duje Mihanović (6):
      ARM: pxa: Convert Spitz OHCI to GPIO descriptors
      ARM: pxa: Convert Spitz LEDs to GPIO descriptors
      ARM: pxa: Convert Spitz CF power control to GPIO descriptors
      ARM: pxa: Convert reset driver to GPIO descriptors
      ARM: pxa: Convert Spitz hsync to GPIO descriptors
      ARM: pxa: Convert gumstix Bluetooth to GPIO descriptors

 arch/arm/mach-pxa/gumstix.c    | 24 ++++++++-------
 arch/arm/mach-pxa/reset.c      | 39 ++++++++---------------
 arch/arm/mach-pxa/reset.h      |  3 +-
 arch/arm/mach-pxa/spitz.c      | 70 +++++++++++++++++++++++++++++++++---------
 drivers/usb/host/ohci-pxa27x.c |  7 +++++
 5 files changed, 90 insertions(+), 53 deletions(-)
---
base-commit: 6465e260f48790807eef06b583b38ca9789b6072
change-id: 20230807-pxa-gpio-3ce25d574814

Best regards,

Comments

Andy Shevchenko Sept. 26, 2023, 4:15 p.m. UTC | #1
On Tue, Sep 26, 2023 at 05:46:24PM +0200, Duje Mihanović wrote:
> Sharp's Spitz board still uses the legacy GPIO interface for controlling
> the power supply to its CF and SD card slots.
> 
> Convert it to use the GPIO descriptor interface.

...

> +	cf_power = gpiod_get(&pxa_device_mci.dev, "cf_power", GPIOD_ASIS);
> +	if (IS_ERR(cf_power)) {
> +		dev_err(&pxa_device_mci.dev,
> +				"failed to get power control GPIO with %ld\n",
> +				PTR_ERR(cf_power));
> +		return;
> +	}

> +	gpiod_put(cf_power);

Don't you want to use guarded gpiod_get()?
Okay, it seems not yet in the pending list, but we can survive without that.
Linus Walleij Sept. 26, 2023, 8:26 p.m. UTC | #2
On Tue, Sep 26, 2023 at 5:46 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:

> Sharp's Spitz board still uses the legacy GPIO interface for controlling
> the power supply to its CF and SD card slots.
>
> Convert it to use the GPIO descriptor interface.
>
> Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Duje Mihanović Sept. 27, 2023, 12:56 p.m. UTC | #3
On Tuesday, September 26, 2023 6:15:37 PM CEST Andy Shevchenko wrote:
> On Tue, Sep 26, 2023 at 05:46:24PM +0200, Duje Mihanović wrote:
> > Sharp's Spitz board still uses the legacy GPIO interface for controlling
> > the power supply to its CF and SD card slots.
> > 
> > Convert it to use the GPIO descriptor interface.
> 
> ...
> 
> > +	cf_power = gpiod_get(&pxa_device_mci.dev, "cf_power", GPIOD_ASIS);
> > +	if (IS_ERR(cf_power)) {
> > +		dev_err(&pxa_device_mci.dev,
> > +				"failed to get power control GPIO with 
%ld\n",
> > +				PTR_ERR(cf_power));
> > +		return;
> > +	}
> > 
> > +	gpiod_put(cf_power);
> 
> Don't you want to use guarded gpiod_get()?
> Okay, it seems not yet in the pending list, but we can survive without that.

Can you please elaborate? If I understand correctly, the if statement right 
after gpiod_get is a guard.

Regards,
Duje