From patchwork Mon Jan 22 14:15:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 10178585 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 71E5560353 for ; Mon, 22 Jan 2018 14:16:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 652E12837D for ; Mon, 22 Jan 2018 14:16:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59D0828389; Mon, 22 Jan 2018 14:16:07 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D9D92837D for ; Mon, 22 Jan 2018 14:16:05 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AA700267351; Mon, 22 Jan 2018 15:16:03 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 81F1926735C; Mon, 22 Jan 2018 15:16:02 +0100 (CET) Received: from cvs.linux-mips.org (eddie.linux-mips.org [148.251.95.138]) by alsa0.perex.cz (Postfix) with ESMTP id 6BA4A266B67 for ; Mon, 22 Jan 2018 15:16:00 +0100 (CET) Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990431AbeAVOP7zG-xF (ORCPT ); Mon, 22 Jan 2018 15:15:59 +0100 Date: Mon, 22 Jan 2018 15:15:57 +0100 From: Ladislav Michl To: alsa-devel@alsa-project.org Message-ID: <20180122141557.GA29226@lenoch> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) Cc: Alexandre Belloni , Nicolas Ferre , Peter Rosin Subject: [alsa-devel] [PATCH] ASoC: atmel: Remove check for node pointer X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Probe function is called only after DT compatible is matched, thus node pointer cannot be NULL. Signed-off-by: Ladislav Michl Acked-by: Peter Rosin Acked-by: Alexandre Belloni --- Note: this patch replaces previously sent "ASoC: sam9x5_wm8731: Return -ENODEV when probe does not find OF node" and "ASoC: atmel_wm8904: Return -ENODEV when probe does not find OF node" while taking Alexandre Belloni's advice into account and extending it for the rest of Atmel's drivers. sound/soc/atmel/atmel_wm8904.c | 5 ----- sound/soc/atmel/sam9g20_wm8731.c | 4 ---- sound/soc/atmel/sam9x5_wm8731.c | 5 ----- sound/soc/atmel/tse850-pcm5142.c | 5 ----- 4 files changed, 19 deletions(-) diff --git a/sound/soc/atmel/atmel_wm8904.c b/sound/soc/atmel/atmel_wm8904.c index fbc10f61eb55..0619a9961e0c 100644 --- a/sound/soc/atmel/atmel_wm8904.c +++ b/sound/soc/atmel/atmel_wm8904.c @@ -85,11 +85,6 @@ static int atmel_asoc_wm8904_dt_init(struct platform_device *pdev) struct snd_soc_dai_link *dailink = &atmel_asoc_wm8904_dailink; int ret; - if (!np) { - dev_err(&pdev->dev, "only device tree supported\n"); - return -EINVAL; - } - ret = snd_soc_of_parse_card_name(card, "atmel,model"); if (ret) { dev_err(&pdev->dev, "failed to parse card name\n"); diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index 98f93e79c654..a53f3ee82d30 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c @@ -163,10 +163,6 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev) struct snd_soc_card *card = &snd_soc_at91sam9g20ek; int ret; - if (!np) { - return -ENODEV; - } - ret = atmel_ssc_set_audio(0); if (ret) { dev_err(&pdev->dev, "ssc channel is not valid\n"); diff --git a/sound/soc/atmel/sam9x5_wm8731.c b/sound/soc/atmel/sam9x5_wm8731.c index 920f72565ff2..b177524f5926 100644 --- a/sound/soc/atmel/sam9x5_wm8731.c +++ b/sound/soc/atmel/sam9x5_wm8731.c @@ -83,11 +83,6 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev) struct sam9x5_drvdata *priv; int ret; - if (!np) { - dev_err(&pdev->dev, "No device node supplied\n"); - return -EINVAL; - } - card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); dai = devm_kzalloc(&pdev->dev, sizeof(*dai), GFP_KERNEL); diff --git a/sound/soc/atmel/tse850-pcm5142.c b/sound/soc/atmel/tse850-pcm5142.c index 3a1393283156..73b327e781ab 100644 --- a/sound/soc/atmel/tse850-pcm5142.c +++ b/sound/soc/atmel/tse850-pcm5142.c @@ -327,11 +327,6 @@ static int tse850_dt_init(struct platform_device *pdev) struct device_node *codec_np, *cpu_np; struct snd_soc_dai_link *dailink = &tse850_dailink; - if (!np) { - dev_err(&pdev->dev, "only device tree supported\n"); - return -EINVAL; - } - cpu_np = of_parse_phandle(np, "axentia,cpu-dai", 0); if (!cpu_np) { dev_err(&pdev->dev, "failed to get cpu dai\n");