lkml.org 
[lkml]   [2013]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] rtc: Cocci spatch "ptr_ret.spatch"
From
Date

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c
--- a/drivers/rtc/rtc-da9052.c
+++ b/drivers/rtc/rtc-da9052.c
@@ -249,10 +249,7 @@ static int da9052_rtc_probe(struct platf

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 int da9052_rtc_remove(struct platform_device *pdev)
diff -u -p a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c
--- a/drivers/rtc/rtc-isl12022.c
+++ b/drivers/rtc/rtc-isl12022.c
@@ -267,10 +267,7 @@ static int isl12022_probe(struct i2c_cli
isl12022->rtc = devm_rtc_device_register(&client->dev,
isl12022_driver.driver.name,
&isl12022_rtc_ops, THIS_MODULE);
- if (IS_ERR(isl12022->rtc))
- return PTR_ERR(isl12022->rtc);
-
- return 0;
+ return PTR_RET(isl12022->rtc);
}

static int isl12022_remove(struct i2c_client *client)
diff -u -p a/drivers/rtc/rtc-m48t35.c b/drivers/rtc/rtc-m48t35.c
--- a/drivers/rtc/rtc-m48t35.c
+++ b/drivers/rtc/rtc-m48t35.c
@@ -174,10 +174,7 @@ static int m48t35_probe(struct platform_

priv->rtc = devm_rtc_device_register(&pdev->dev, "m48t35",
&m48t35_ops, THIS_MODULE);
- if (IS_ERR(priv->rtc))
- return PTR_ERR(priv->rtc);
-
- return 0;
+ return PTR_RET(priv->rtc);
}

static int m48t35_remove(struct platform_device *pdev)
diff -u -p a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
--- a/drivers/rtc/rtc-pcf8563.c
+++ b/drivers/rtc/rtc-pcf8563.c
@@ -263,10 +263,7 @@ static int pcf8563_probe(struct i2c_clie
pcf8563_driver.driver.name,
&pcf8563_rtc_ops, THIS_MODULE);

- if (IS_ERR(pcf8563->rtc))
- return PTR_ERR(pcf8563->rtc);
-
- return 0;
+ return PTR_RET(pcf8563->rtc);
}

static int pcf8563_remove(struct i2c_client *client)
diff -u -p a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c
--- a/drivers/rtc/rtc-pcf8583.c
+++ b/drivers/rtc/rtc-pcf8583.c
@@ -283,10 +283,7 @@ static int pcf8583_probe(struct i2c_clie
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 int pcf8583_remove(struct i2c_client *client)



\
 
 \ /
  Last update: 2013-06-01 12:41    [W:0.029 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site