]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: pxa2xx-ac97: Remove platform_data
authorPeng Fan <peng.fan@nxp.com>
Thu, 22 Jan 2026 12:44:59 +0000 (20:44 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 27 Jan 2026 12:45:56 +0000 (12:45 +0000)
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>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260122-sound-cleanup-v1-3-0a91901609b8@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/arm/pxa2xx-ac97-lib.c
sound/soc/pxa/pxa2xx-ac97.c

index 64510318091f4a6700dfab67479cc1465c545294..0a28e44118c5253054370b6d8117d8b61fa257fd 100644 (file)
@@ -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;
index 78f50032afc5d93acf8945793cd589bc5bf2f862..109a4958d9c04c6b027d89524ee3493d98330c1a 100644 (file)
@@ -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);