Patchwork [5/5] drivers/rtc/rtc-pcf8583.c: Use PTR_RET()

login
register
mail settings
Submitter Sachin Kamat
Date May 30, 2013, 8:26 a.m.
Message ID <1369902394-24269-5-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/247498/
State New
Headers show

Comments

Sachin Kamat - May 30, 2013, 8:26 a.m.
Use of PTR_RET() simplifies the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/rtc/rtc-pcf8583.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c
index ab740cd..843a745 100644
--- a/drivers/rtc/rtc-pcf8583.c
+++ b/drivers/rtc/rtc-pcf8583.c
@@ -17,6 +17,7 @@ 
 #include <linux/slab.h>
 #include <linux/rtc.h>
 #include <linux/init.h>
+#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/bcd.h>
 
@@ -284,10 +285,7 @@  static int pcf8583_probe(struct i2c_client *client,
 				pcf8583_driver.driver.name,
 				&pcf8583_rtc_ops, THIS_MODULE);
 
-	if (IS_ERR(pcf8583->rtc))
-		return PTR_ERR(pcf8583->rtc);
-
-	return 0;
+	return PTR_RET(pcf8583->rtc);
 }
 
 static const struct i2c_device_id pcf8583_id[] = {