lkml.org 
[lkml]   [2015]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 5/5] net: dsa: exit probe if no switch were found
From
Date
Le 03/10/2015 07:26, Neil Armstrong a écrit :
> If no switch were found in dsa_setup_dst, return -ENODEV and
> exit the dsa_probe cleanly.
>
> Tested-by: Andrew Lunn <andrew@lunn.ch>
> Tested-by: Florian Fainelli <f.fainelli@gmail.com>
> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
> ---

[snip]

> static int dsa_probe(struct platform_device *pdev)
> @@ -926,9 +937,9 @@ static int dsa_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, dst);
>
> - dsa_setup_dst(dst, dev, &pdev->dev, pd);
> -
> - return 0;
> + ret = dsa_setup_dst(dst, dev, &pdev->dev, pd);
> + if (!ret)
> + return 0;

That logic is a little weird, I would just go with something like this:

ret = dsa_setup_dst(ds, dev, &pdev->dev, pd);
if (ret)
goto out;

return 0;
--
Florian


\
 
 \ /
  Last update: 2015-10-03 22:41    [W:0.044 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site