[PATCH] rtc: sd3078: fix ptr_ret.cocci warnings

From: kbuild test robot
Date: Sat Nov 10 2018 - 10:58:26 EST


From: kbuild test robot <fengguang.wu@xxxxxxxxx>

drivers/rtc/rtc-sd3078.c:248: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

Fixes: e231edadd7fa ("rtc: sd3078: new driver.")
CC: zoro <long17.cool@xxxxxxx>
Signed-off-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
---

url: https://github.com/0day-ci/linux/commits/zoro/dt-bindings-define-vendor-prefix-for-whwave-Inc/20181110-205048
base: https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next

rtc-sd3078.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/rtc/rtc-sd3078.c
+++ b/drivers/rtc/rtc-sd3078.c
@@ -245,10 +245,7 @@ static int sd3078_probe(struct i2c_clien
sd3078_driver.driver.name,
&sd3078_rtc_ops, THIS_MODULE);

- if (IS_ERR(sd3078->rtc))
- return PTR_ERR(sd3078->rtc);
-
- return 0;
+ return PTR_ERR_OR_ZERO(sd3078->rtc);
}

static int sd3078_remove(struct i2c_client *client)