diff mbox

[2/2] rtc: pcf85063: remove struct pcf85063

Message ID 1456914343-4611-2-git-send-email-alexandre.belloni@free-electrons.com
State Accepted
Headers show

Commit Message

Alexandre Belloni March 2, 2016, 10:25 a.m. UTC
No members of struct pcf85063 are used anymore, remove the whole structure.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/rtc/rtc-pcf85063.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

Comments

Juergen Borleis March 3, 2016, 3:14 p.m. UTC | #1
On Wednesday 02 March 2016 11:25:43 Alexandre Belloni wrote:
> No members of struct pcf85063 are used anymore, remove the whole structure.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  drivers/rtc/rtc-pcf85063.c | 22 +++++-----------------
>  1 file changed, 5 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
> index 550f67518c5a..e8ddbb359d11 100644
> --- a/drivers/rtc/rtc-pcf85063.c
> +++ b/drivers/rtc/rtc-pcf85063.c
> @@ -31,11 +31,6 @@
>
>  static struct i2c_driver pcf85063_driver;
>
> -struct pcf85063 {
> -	struct rtc_device *rtc;
> -	int voltage_low; /* indicates if a low_voltage was detected */
> -};
> -
>  static int pcf85063_stop_clock(struct i2c_client *client, u8 *ctrl1)
>  {
>  	s32 ret;
> @@ -168,25 +163,18 @@ static const struct rtc_class_ops pcf85063_rtc_ops = {
>  static int pcf85063_probe(struct i2c_client *client, 
>  				const struct i2c_device_id *id)
>  {
> -	struct pcf85063 *pcf85063;
> +	struct rtc_device *rtc;
>
>  	dev_dbg(&client->dev, "%s\n", __func__);
>
>  	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
>  		return -ENODEV;
>
> -	pcf85063 = devm_kzalloc(&client->dev, sizeof(struct pcf85063),
> -				GFP_KERNEL);
> -	if (!pcf85063)
> -		return -ENOMEM;
> -
> -	i2c_set_clientdata(client, pcf85063);
> -
> -	pcf85063->rtc = devm_rtc_device_register(&client->dev,
> -				pcf85063_driver.driver.name,
> -				&pcf85063_rtc_ops, THIS_MODULE);
> +	rtc = devm_rtc_device_register(&client->dev,
> +				       pcf85063_driver.driver.name,
> +				       &pcf85063_rtc_ops, THIS_MODULE);
>
> -	return PTR_ERR_OR_ZERO(pcf85063->rtc);
> +	return PTR_ERR_OR_ZERO(rtc);
>  }
>
>  static const struct i2c_device_id pcf85063_id[] = {

Reviewed-by: Juergen Borleis <jbe@pengutronix.de>

jb
diff mbox

Patch

diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
index 550f67518c5a..e8ddbb359d11 100644
--- a/drivers/rtc/rtc-pcf85063.c
+++ b/drivers/rtc/rtc-pcf85063.c
@@ -31,11 +31,6 @@ 
 
 static struct i2c_driver pcf85063_driver;
 
-struct pcf85063 {
-	struct rtc_device *rtc;
-	int voltage_low; /* indicates if a low_voltage was detected */
-};
-
 static int pcf85063_stop_clock(struct i2c_client *client, u8 *ctrl1)
 {
 	s32 ret;
@@ -168,25 +163,18 @@  static const struct rtc_class_ops pcf85063_rtc_ops = {
 static int pcf85063_probe(struct i2c_client *client,
 				const struct i2c_device_id *id)
 {
-	struct pcf85063 *pcf85063;
+	struct rtc_device *rtc;
 
 	dev_dbg(&client->dev, "%s\n", __func__);
 
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
 		return -ENODEV;
 
-	pcf85063 = devm_kzalloc(&client->dev, sizeof(struct pcf85063),
-				GFP_KERNEL);
-	if (!pcf85063)
-		return -ENOMEM;
-
-	i2c_set_clientdata(client, pcf85063);
-
-	pcf85063->rtc = devm_rtc_device_register(&client->dev,
-				pcf85063_driver.driver.name,
-				&pcf85063_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&client->dev,
+				       pcf85063_driver.driver.name,
+				       &pcf85063_rtc_ops, THIS_MODULE);
 
-	return PTR_ERR_OR_ZERO(pcf85063->rtc);
+	return PTR_ERR_OR_ZERO(rtc);
 }
 
 static const struct i2c_device_id pcf85063_id[] = {