* [PATCH v1 1/1] ASoC: pxa2xx-ac97: Use devm_gpiod_get_optional()
@ 2026-01-29 13:33 Andy Shevchenko
2026-02-02 5:16 ` Peng Fan
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-01-29 13:33 UTC (permalink / raw)
To: Peng Fan, linux-arm-kernel, linux-sound, linux-kernel
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Jaroslav Kysela,
Takashi Iwai, Andy Shevchenko
No need to open code the devm_gpiod_get_optional() wrapper.
Instead of checking for a certain error code, check for NULL.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
sound/arm/pxa2xx-ac97-lib.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
index 1e114dbcf93c..47889f6003c1 100644
--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -330,13 +330,12 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)
if (dev->dev.of_node) {
/* Assert reset using GPIOD_OUT_HIGH, because reset is GPIO_ACTIVE_LOW */
- rst_gpio = devm_gpiod_get(&dev->dev, "reset", GPIOD_OUT_HIGH);
+ rst_gpio = devm_gpiod_get_optional(&dev->dev, "reset", GPIOD_OUT_HIGH);
ret = PTR_ERR(rst_gpio);
- if (ret == -ENOENT)
- reset_gpio = -1;
- else if (ret)
+ if (ret)
return ret;
- reset_gpio = desc_to_gpio(rst_gpio);
+
+ reset_gpio = rst_gpio ? desc_to_gpio(rst_gpio) : -1;
} else {
if (cpu_is_pxa27x())
reset_gpio = 113;
--
2.50.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* RE: [PATCH v1 1/1] ASoC: pxa2xx-ac97: Use devm_gpiod_get_optional()
2026-01-29 13:33 [PATCH v1 1/1] ASoC: pxa2xx-ac97: Use devm_gpiod_get_optional() Andy Shevchenko
@ 2026-02-02 5:16 ` Peng Fan
2026-02-28 11:12 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Peng Fan @ 2026-02-02 5:16 UTC (permalink / raw)
To: Andy Shevchenko, linux-arm-kernel@lists.infradead.org,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Jaroslav Kysela,
Takashi Iwai
> Subject: [PATCH v1 1/1] ASoC: pxa2xx-ac97: Use
> devm_gpiod_get_optional()
>
> No need to open code the devm_gpiod_get_optional() wrapper.
> Instead of checking for a certain error code, check for NULL.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] ASoC: pxa2xx-ac97: Use devm_gpiod_get_optional()
2026-02-02 5:16 ` Peng Fan
@ 2026-02-28 11:12 ` Andy Shevchenko
0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-02-28 11:12 UTC (permalink / raw)
To: Peng Fan
Cc: linux-arm-kernel@lists.infradead.org, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, Jaroslav Kysela, Takashi Iwai
On Mon, Feb 02, 2026 at 05:16:11AM +0000, Peng Fan wrote:
> > Subject: [PATCH v1 1/1] ASoC: pxa2xx-ac97: Use
> > devm_gpiod_get_optional()
> >
> > No need to open code the devm_gpiod_get_optional() wrapper.
> > Instead of checking for a certain error code, check for NULL.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
Thanks!
Mark, did this slip through cracks?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-28 11:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29 13:33 [PATCH v1 1/1] ASoC: pxa2xx-ac97: Use devm_gpiod_get_optional() Andy Shevchenko
2026-02-02 5:16 ` Peng Fan
2026-02-28 11:12 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox