From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Belloni Subject: Re: [PATCH 3/5] ASoC: sam9x5_wm8731: Return -ENODEV when probe does not find OF node Date: Mon, 15 Jan 2018 09:20:25 +0100 Message-ID: <20180115082025.GQ2678@piout.net> References: <20180115075213.GA10762@lenoch> <20180115075351.GD10762@lenoch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by alsa0.perex.cz (Postfix) with ESMTP id 1FB5B266FBD for ; Mon, 15 Jan 2018 09:20:25 +0100 (CET) Content-Disposition: inline In-Reply-To: <20180115075351.GD10762@lenoch> 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 To: Ladislav Michl Cc: alsa-devel@alsa-project.org, Liam Girdwood , Nicolas Ferre , Takashi Iwai , Mark Brown , SF Markus Elfring List-Id: alsa-devel@alsa-project.org On 15/01/2018 at 08:53:51 +0100, Ladislav Michl wrote: > 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; > This will never happen, you may as well just remove the test. > card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL); > priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); > -- > 2.15.1 > -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com