From: Peng Fan <peng.fan@nxp.com>
Since commit d6df7df7ae5a0 ("ARM: pxa: remove unused board files"), there
has been no in-tree user to create the device with platform data. So remove
them.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
sound/arm/pxa2xx-ac97-lib.c | 33 ++++++---------------------------
sound/soc/pxa/pxa2xx-ac97.c | 5 +----
2 files changed, 7 insertions(+), 31 deletions(-)
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
index 64510318091f4a6700dfab67479cc1465c545294..0a28e44118c5253054370b6d8117d8b61fa257fd 100644
--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -321,7 +321,6 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)
{
int ret;
int irq;
- pxa2xx_audio_ops_t *pdata = dev->dev.platform_data;
ac97_reg_base = devm_platform_ioremap_resource(dev, 0);
if (IS_ERR(ac97_reg_base)) {
@@ -329,32 +328,12 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)
return PTR_ERR(ac97_reg_base);
}
- if (pdata) {
- switch (pdata->reset_gpio) {
- case 95:
- case 113:
- reset_gpio = pdata->reset_gpio;
- break;
- case 0:
- reset_gpio = 113;
- break;
- case -1:
- break;
- default:
- dev_err(&dev->dev, "Invalid reset GPIO %d\n",
- pdata->reset_gpio);
- }
- } else if (!pdata && dev->dev.of_node) {
- pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL);
- if (!pdata)
- return -ENOMEM;
- pdata->reset_gpio = of_get_named_gpio(dev->dev.of_node,
- "reset-gpios", 0);
- if (pdata->reset_gpio == -ENOENT)
- pdata->reset_gpio = -1;
- else if (pdata->reset_gpio < 0)
- return pdata->reset_gpio;
- reset_gpio = pdata->reset_gpio;
+ if (dev->dev.of_node) {
+ reset_gpio = of_get_named_gpio(dev->dev.of_node, "reset-gpios", 0);
+ if (reset_gpio == -ENOENT)
+ reset_gpio = -1;
+ else if (reset_gpio < 0)
+ return reset_gpio;
} else {
if (cpu_is_pxa27x())
reset_gpio = 113;
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 78f50032afc5d93acf8945793cd589bc5bf2f862..109a4958d9c04c6b027d89524ee3493d98330c1a 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -222,9 +222,7 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
{
int ret;
struct ac97_controller *ctrl;
- pxa2xx_audio_ops_t *pdata = pdev->dev.platform_data;
struct resource *regs;
- void **codecs_pdata;
if (pdev->id != -1) {
dev_err(&pdev->dev, "PXA2xx has only one AC97 port.\n");
@@ -247,10 +245,9 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
return ret;
}
- codecs_pdata = pdata ? pdata->codec_pdata : NULL;
ctrl = snd_ac97_controller_register(&pxa2xx_ac97_ops, &pdev->dev,
AC97_SLOTS_AVAILABLE_ALL,
- codecs_pdata);
+ NULL);
if (IS_ERR(ctrl))
return PTR_ERR(ctrl);
--
2.37.1
On Thu, Jan 22, 2026 at 08:44:59PM +0800, Peng Fan (OSS) wrote:
> Since commit d6df7df7ae5a0 ("ARM: pxa: remove unused board files"), there
> has been no in-tree user to create the device with platform data. So remove
> them.
I like the changes for PXA27x, but one important comment below.
...
> + if (dev->dev.of_node) {
> + reset_gpio = of_get_named_gpio(dev->dev.of_node, "reset-gpios", 0);
> + if (reset_gpio == -ENOENT)
> + reset_gpio = -1;
> + else if (reset_gpio < 0)
> + return reset_gpio;
No, please convert to devm_gpiod_get*() or even better to use reset-gpio driver.
TL;DR: no (reinstantiated) of_get_named_gpio() or alike must be in the kernel.
> } else {
> if (cpu_is_pxa27x())
> reset_gpio = 113;
--
With Best Regards,
Andy Shevchenko
On Thu, Jan 22, 2026 at 04:58:59PM +0200, Andy Shevchenko wrote:
> On Thu, Jan 22, 2026 at 08:44:59PM +0800, Peng Fan (OSS) wrote:
...
> > + if (dev->dev.of_node) {
> > + reset_gpio = of_get_named_gpio(dev->dev.of_node, "reset-gpios", 0);
> > + if (reset_gpio == -ENOENT)
> > + reset_gpio = -1;
> > + else if (reset_gpio < 0)
> > + return reset_gpio;
>
> No, please convert to devm_gpiod_get*() or even better to use reset-gpio driver.
> TL;DR: no (reinstantiated) of_get_named_gpio() or alike must be in the kernel.
Ah, you do it in the followup, right?
If that is the case (I'm going to look into it after this one)
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
And thanks for cleaning it up, eventually!
> > } else {
> > if (cpu_is_pxa27x())
> > reset_gpio = 113;
--
With Best Regards,
Andy Shevchenko
© 2016 - 2026 Red Hat, Inc.