watchdog: coh901327_wdt: Simplify error handling in probe function

Checking if there is no error followed by a goto if there is one is
confusing. Reverse the logic.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Guenter Roeck 2017-01-03 03:22:09 -08:00
parent 0397c5db1d
commit 01372ae13b
1 changed files with 2 additions and 4 deletions

View File

@ -360,12 +360,10 @@ static int __init coh901327_probe(struct platform_device *pdev)
coh901327_wdt.parent = &pdev->dev;
ret = watchdog_register_device(&coh901327_wdt);
if (ret == 0)
dev_info(&pdev->dev,
"initialized. timer margin=%d sec\n", margin);
else
if (ret)
goto out_no_wdog;
dev_info(&pdev->dev, "initialized. timer margin=%d sec\n", margin);
return 0;
out_no_wdog: