Skip to content

Commit

Permalink
rtc: gemini: fix ptr_ret.cocci warnings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kbuild test robot authored and Alexandre Belloni committed Sep 5, 2015
1 parent e7cba88 commit 202cc98
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/rtc/rtc-gemini.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 202cc98

Please sign in to comment.