[PATCH] rtc: Cocci spatch "ptr_ret.spatch"

From: Thomas Meyer
Date: Sat Jun 01 2013 - 05:58:44 EST



Signed-off-by: Thomas Meyer <thomas@xxxxxxxx>
---

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)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/