diff options
author | Guenter Roeck <linux@roeck-us.net> | 2017-01-03 03:22:09 -0800 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-02-24 14:00:23 -0800 |
commit | 01372ae13ba6a4792de2f4bd474f1374b5404448 (patch) | |
tree | c3f304133ef07b8bd74e127fb42a08293bd7dcac /drivers/watchdog/coh901327_wdt.c | |
parent | 0397c5db1d3174a553da674bb779007cc62cc241 (diff) | |
download | op-kernel-dev-01372ae13ba6a4792de2f4bd474f1374b5404448.zip op-kernel-dev-01372ae13ba6a4792de2f4bd474f1374b5404448.tar.gz |
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>
Diffstat (limited to 'drivers/watchdog/coh901327_wdt.c')
-rw-r--r-- | drivers/watchdog/coh901327_wdt.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c index a099b77..dc97b2f 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: |