From: Guenter Roeck Date: Tue, 3 Jan 2017 11:22:09 +0000 (-0800) Subject: watchdog: coh901327_wdt: Simplify error handling in probe function X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=01372ae13ba6a4792de2f4bd474f1374b5404448;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Guenter Roeck --- diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c index a099b77fc0b9..dc97b2fd6c49 100644 --- a/drivers/watchdog/coh901327_wdt.c +++ b/drivers/watchdog/coh901327_wdt.c @@ -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: