From patchwork Mon Jan 15 07:53:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 10163239 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 5A26560325 for ; Mon, 15 Jan 2018 07:54:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4353C201A4 for ; Mon, 15 Jan 2018 07:54:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36C772865F; Mon, 15 Jan 2018 07:54:00 +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 F22BE201A4 for ; Mon, 15 Jan 2018 07:53:58 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BFC702673E7; Mon, 15 Jan 2018 08:53:57 +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 0732A267428; Mon, 15 Jan 2018 08:53:56 +0100 (CET) Received: from cvs.linux-mips.org (eddie.linux-mips.org [148.251.95.138]) by alsa0.perex.cz (Postfix) with ESMTP id 1688426731C for ; Mon, 15 Jan 2018 08:53:54 +0100 (CET) Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990477AbeAOHxxsuT-u (ORCPT ); Mon, 15 Jan 2018 08:53:53 +0100 Date: Mon, 15 Jan 2018 08:53:51 +0100 From: Ladislav Michl To: alsa-devel@alsa-project.org Message-ID: <20180115075351.GD10762@lenoch> References: <20180115075213.GA10762@lenoch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180115075213.GA10762@lenoch> User-Agent: Mutt/1.9.2 (2017-12-15) Cc: Liam Girdwood , Nicolas Ferre , Takashi Iwai , Mark Brown , Alexandre Belloni , SF Markus Elfring Subject: [alsa-devel] [PATCH 3/5] ASoC: sam9x5_wm8731: Return -ENODEV when probe does not find OF node 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 should fail with -ENODEV when called with NULL pdev->dev.of_node. Signed-off-by: Ladislav Michl --- sound/soc/atmel/sam9x5_wm8731.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/atmel/sam9x5_wm8731.c b/sound/soc/atmel/sam9x5_wm8731.c index e6c303ab869d..9db08826b32a 100644 --- a/sound/soc/atmel/sam9x5_wm8731.c +++ b/sound/soc/atmel/sam9x5_wm8731.c @@ -84,10 +84,8 @@ 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; - } + if (!np) + return -ENODEV; card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);