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

login
register
mail settings
Submitter Sachin Kamat
Date May 30, 2013, 8:26 a.m.
Message ID <1369902394-24269-1-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/247494/
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>
Cc: David Dajun Chen <dchen@diasemi.com>
---
 drivers/rtc/rtc-da9052.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c
index 2f7fdd7..9c8c194 100644
--- a/drivers/rtc/rtc-da9052.c
+++ b/drivers/rtc/rtc-da9052.c
@@ -15,6 +15,7 @@ 
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/rtc.h>
+#include <linux/err.h>
 
 #include <linux/mfd/da9052/da9052.h>
 #include <linux/mfd/da9052/reg.h>
@@ -249,10 +250,7 @@  static int da9052_rtc_probe(struct platform_device *pdev)
 
 	rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
 				       &da9052_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtc->rtc))
-		return PTR_ERR(rtc->rtc);
-
-	return 0;
+	return PTR_RET(rtc->rtc);
 }
 
 static struct platform_driver da9052_rtc_driver = {