[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1370080711.29224.34.camel@localhost.localdomain>
Date: Sat, 01 Jun 2013 11:58:31 +0200
From: Thomas Meyer <thomas@...3r.de>
To: a.zummo@...ertech.it, rtc-linux@...glegroups.com,
linux-kernel@...r.kernel.org
Subject: [PATCH] rtc: Cocci spatch "ptr_ret.spatch"
Signed-off-by: Thomas Meyer <thomas@...3r.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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists