rtc: gemini: fix ptr_ret.cocci warnings
authorkbuild test robot <fengguang.wu@intel.com>
Fri, 31 Jul 2015 09:31:04 +0000 (15:01 +0530)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 5 Sep 2015 11:19:09 +0000 (13:19 +0200)
drivers/rtc/rtc-gemini.c:151:1-3: WARNING: PTR_ERR_OR_ZERO can be used

 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-gemini.c

index 2fed93e1114a6d2cbbd550b1de573df04b0bebc0..e84184647d1525fe720c6ed73f86da92f3d634ce 100644 (file)
@@ -148,10 +148,7 @@ static int gemini_rtc_probe(struct platform_device *pdev)
 
        rtc->rtc_dev = rtc_device_register(pdev->name, dev,
                                           &gemini_rtc_ops, THIS_MODULE);
-       if (IS_ERR(rtc->rtc_dev))
-               return PTR_ERR(rtc->rtc_dev);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(rtc->rtc_dev);
 }
 
 static int gemini_rtc_remove(struct platform_device *pdev)