linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/11] ASoC: ab8500-codec: remove platform data based probe
Date: Tue,  5 Jul 2016 14:45:02 +0200	[thread overview]
Message-ID: <1467722710-1577-3-git-send-email-linus.walleij@linaro.org> (raw)
In-Reply-To: <1467722710-1577-1-git-send-email-linus.walleij@linaro.org>

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(-)

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);
-- 
2.4.11

  parent reply	other threads:[~2016-07-05 12:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-05 12:45 [PATCH 01/11] ARM: ux500: remove unused regulator data Linus Walleij
2016-07-05 12:45 ` [PATCH 02/11] ARM: ux500: move ab8500_regulator_plat_data into driver Linus Walleij
2016-07-05 13:43   ` Mark Brown
2016-07-05 12:45 ` Linus Walleij [this message]
2016-07-05 13:44   ` [PATCH 03/11] ASoC: ab8500-codec: remove platform data based probe Mark Brown
2016-07-05 13:44   ` Mark Brown
2016-07-05 15:22     ` Linus Walleij
2016-07-05 15:37       ` Arnd Bergmann
2016-07-07 10:08       ` Mark Brown
2016-07-05 12:45 ` [PATCH 04/11] mfd: db8500 stop passing around platform data Linus Walleij
2016-07-11 16:19   ` Linus Walleij
2016-07-11 16:48   ` Lee Jones
2016-07-05 12:45 ` [PATCH 05/11] ARM: ux500: move l2x0 init to .init_irq Linus Walleij
2016-07-05 12:45 ` [PATCH 06/11] ARM: ux500: use CLK_OF_DECLARE() Linus Walleij
2016-07-05 12:45 ` [PATCH 07/11] ARM: ux500: remove cpu_is_u* helpers Linus Walleij
2016-07-05 12:45 ` [PATCH 08/11] ARM: ux500: consolidate soc_device code in id.c Linus Walleij
2016-07-05 12:45 ` [PATCH 09/11] ARM: ux500: call ux500_setup_id later Linus Walleij
2016-07-05 12:45 ` [PATCH 10/11] ARM: ux500: move soc_id driver to drivers/soc Linus Walleij
2016-07-05 12:45 ` [PATCH 11/11] ARM: ux500: consolidate base platform files Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467722710-1577-3-git-send-email-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).