linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] watchdog: coh901327_wdt: Simplify error handling in probe function
@ 2017-01-04  3:25 Guenter Roeck
  2017-01-04  3:25 ` [PATCH 2/4] watchdog: coh901327_wdt: Keep clock enabled after loading driver Guenter Roeck
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Guenter Roeck @ 2017-01-04  3:25 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Wim Van Sebroeck, linux-arm-kernel, linux-watchdog, linux-kernel,
	Guenter Roeck

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

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/coh901327_wdt.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

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:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-09 20:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-04  3:25 [PATCH 1/4] watchdog: coh901327_wdt: Simplify error handling in probe function Guenter Roeck
2017-01-04  3:25 ` [PATCH 2/4] watchdog: coh901327_wdt: Keep clock enabled after loading driver Guenter Roeck
2017-01-09 19:38   ` Linus Walleij
2017-01-04  3:25 ` [PATCH 3/4] watchdog: coh901327_wdt: Use devm_ioremap_resource to map resources Guenter Roeck
2017-01-09 19:39   ` Linus Walleij
2017-01-04  3:25 ` [PATCH 4/4] watchdog: coh901327_wdt: Use dev variable instead of pdev->dev Guenter Roeck
2017-01-09 19:39   ` Linus Walleij
2017-01-09 19:38 ` [PATCH 1/4] watchdog: coh901327_wdt: Simplify error handling in probe function Linus Walleij
2017-01-09 20:17   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).