From patchwork Tue Jul 5 12:45:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9214181 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F48A6048B for ; Tue, 5 Jul 2016 12:48:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EDD928A61 for ; Tue, 5 Jul 2016 12:48:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3327828A64; Tue, 5 Jul 2016 12:48:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B348D28A61 for ; Tue, 5 Jul 2016 12:48:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bKPjh-00021z-Px; Tue, 05 Jul 2016 12:45:57 +0000 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bKPjW-0001gR-TP for linux-arm-kernel@lists.infradead.org; Tue, 05 Jul 2016 12:45:48 +0000 Received: by mail-lf0-x236.google.com with SMTP id h129so134030605lfh.1 for ; Tue, 05 Jul 2016 05:45:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=97gsSASUpYgEKjNGNqRkHbkzgVYc3EepmAXGYzMf2QI=; b=Y1jCiT9NBJnSCtSVrWEPWfDpps3o+CT3sJzS7S1SqeFDvVqnJ1HwjG1fQrwPdYVMsc uqDqPxAlHDbOKrZL7+Vg2Ukwj2RTnzsioojs3j8k40lj4buf2mhX8jT9oapDWRVYSkfu MCt42YOe/5jWx487+SWsvL5NH7qb3lukmu22c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=97gsSASUpYgEKjNGNqRkHbkzgVYc3EepmAXGYzMf2QI=; b=S24n09CzrmYpQ03or4wtJwVU5FFbnu7gD8nxiTVrb7RWscc6iTB5G/E1KIRvFhhkaI lYiiovPdB/wrnS8NxK13CN67ppBpXOq0qmt5xb8i8fQbUnezRvm30eySZm+oiEK/YHW1 xii0PoQI0/+eHKzdU8bZ4znzZwhPMgWWdsTasKQfPDGtly5GnaivxqzaxiDKfFps6UQu 4jrSu7Njm+nFmdsp7NSe/Jp0JBat0n2JmFGfRvVCYoBIMVYWwuYo3v4YAmIcVAJdlRpP laz5u2qFCQ7itqdRMwSZf1aH1QRxC+3+JpUBWWQJgzDOU9vo37t2VwCWzqzeHKb7zgYk N6PA== X-Gm-Message-State: ALyK8tKuXCWi3oM4oOGDEmBnEDmvckdAAwxZXrHKUTO9qsLdgLT1myGIIWVz7WdAp9l9GWNO X-Received: by 10.25.131.200 with SMTP id f191mr4580465lfd.219.1467722727107; Tue, 05 Jul 2016 05:45:27 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id g29sm1022687ljg.25.2016.07.05.05.45.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jul 2016 05:45:26 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Mark Brown , Lee Jones Subject: [PATCH 03/11] ASoC: ab8500-codec: remove platform data based probe Date: Tue, 5 Jul 2016 14:45:02 +0200 Message-Id: <1467722710-1577-3-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1467722710-1577-1-git-send-email-linus.walleij@linaro.org> References: <1467722710-1577-1-git-send-email-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160705_054547_251414_340E9691 X-CRM114-Status: GOOD ( 15.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linus Walleij MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Arnd Bergmann 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 Signed-off-by: Arnd Bergmann Signed-off-by: Linus Walleij Acked-by: Mark Brown Acked-by: Mark Brown --- 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);