diff mbox series

[03/11] ASoC: ab8500-codec: remove platform data based probe

Message ID 1467722710-1577-3-git-send-email-linus.walleij@linaro.org
State Accepted
Commit cf4129ea212d71f7860bded25d42388265172bee
Headers show
Series None | expand

Commit Message

Linus Walleij July 5, 2016, 12:45 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>


The ux500 platform hasn't used board files for a long time, and
nothing defines a ab8500_codec_platform_data, so we can just
remove the probing based on that and always use device tree
properties directly.

Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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

---
Mark: if this makes sense to you, please provide an ACK so Arnd
can merge this cleanup.
---
 sound/soc/codecs/ab8500-codec.c | 33 ++++-----------------------------
 1 file changed, 4 insertions(+), 29 deletions(-)

-- 
2.4.11


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Comments

Mark Brown July 5, 2016, 1:44 p.m. UTC | #1
On Tue, Jul 05, 2016 at 02:45:02PM +0200, Linus Walleij wrote:
> From: Arnd Bergmann <arnd@arndb.de>

> 

> The ux500 platform hasn't used board files for a long time, and

> nothing defines a ab8500_codec_platform_data, so we can just

> remove the probing based on that and always use device tree

> properties directly.


Acked-by: Mark Brown <broonie@kernel.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown July 5, 2016, 1:44 p.m. UTC | #2
On Tue, Jul 05, 2016 at 02:45:02PM +0200, Linus Walleij wrote:

> Mark: if this makes sense to you, please provide an ACK so Arnd

> can merge this cleanup.


I'm still not clear what dependency this has on anything elsein the
series.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Linus Walleij July 5, 2016, 3:22 p.m. UTC | #3
On Tue, Jul 5, 2016 at 3:44 PM, Mark Brown <broonie@kernel.org> wrote:
> On Tue, Jul 05, 2016 at 02:45:02PM +0200, Linus Walleij wrote:

>

>> Mark: if this makes sense to you, please provide an ACK so Arnd

>> can merge this cleanup.

>

> I'm still not clear what dependency this has on anything elsein the

> series.


None whatsoever if I'm reading it right. The series also compiles
fine without it.

Do you prefer to apply it to the ASoC tree? I can drop
it from this series.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown July 7, 2016, 10:08 a.m. UTC | #4
On Tue, Jul 05, 2016 at 05:22:22PM +0200, Linus Walleij wrote:

> Do you prefer to apply it to the ASoC tree? I can drop

> it from this series.


In general yes but it's also that if it looks like there should be some
dependency due to it being a series and I can't see one then that makes
me think I've missed something when reviewing and need to check.  Anyway:

Acked-by: Mark Brown <broonie@kernel.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff mbox series

Patch

diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c
index 8b1d0c1a7839..2fc89155f14a 100644
--- a/sound/soc/codecs/ab8500-codec.c
+++ b/sound/soc/codecs/ab8500-codec.c
@@ -2464,45 +2464,20 @@  static int ab8500_codec_probe(struct snd_soc_codec *codec)
 	struct device *dev = codec->dev;
 	struct device_node *np = dev->of_node;
 	struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(dev);
-	struct ab8500_platform_data *pdata;
+	struct ab8500_codec_platform_data codec_pdata;
 	struct filter_control *fc;
 	int status;
 
 	dev_dbg(dev, "%s: Enter.\n", __func__);
 
-	/* Setup AB8500 according to board-settings */
-	pdata = dev_get_platdata(dev->parent);
+	ab8500_codec_of_probe(dev, np, &codec_pdata);
 
-	if (np) {
-		if (!pdata)
-			pdata = devm_kzalloc(dev,
-					sizeof(struct ab8500_platform_data),
-					GFP_KERNEL);
-
-		if (pdata && !pdata->codec)
-			pdata->codec
-				= devm_kzalloc(dev,
-					sizeof(struct ab8500_codec_platform_data),
-					GFP_KERNEL);
-
-		if (!(pdata && pdata->codec))
-			return -ENOMEM;
-
-		ab8500_codec_of_probe(dev, np, pdata->codec);
-
-	} else {
-		if (!(pdata && pdata->codec)) {
-			dev_err(dev, "No codec platform data or DT found\n");
-			return -EINVAL;
-		}
-	}
-
-	status = ab8500_audio_setup_mics(codec, &pdata->codec->amics);
+	status = ab8500_audio_setup_mics(codec, &codec_pdata.amics);
 	if (status < 0) {
 		pr_err("%s: Failed to setup mics (%d)!\n", __func__, status);
 		return status;
 	}
-	status = ab8500_audio_set_ear_cmv(codec, pdata->codec->ear_cmv);
+	status = ab8500_audio_set_ear_cmv(codec, codec_pdata.ear_cmv);
 	if (status < 0) {
 		pr_err("%s: Failed to set earpiece CM-voltage (%d)!\n",
 			__func__, status);