Skip to contentSkip to conversation

rtc: rtc-ab3100: use devm_rtc_device_register()

PATCH New Jingoo Han 1 participant 30 messages Mar 14, 2013

Subsystems (4)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/30 rtc: rtc-ab3100: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-ab3100.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/rtc/rtc-ab3100.c +2 -5
index c2f12d3..47a4f2c 100644
@@ -229,8 +229,8 @@ static int __init ab3100_rtc_probe(struct platform_device *pdev)
 		/* Ignore any error on this write */
 	}
 
-	rtc = rtc_device_register("ab3100-rtc", &pdev->dev, &ab3100_rtc_ops,
-				  THIS_MODULE);
+	rtc = devm_rtc_device_register(&pdev->dev, "ab3100-rtc",
+					&ab3100_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc)) {
 		err = PTR_ERR(rtc);
 		return err;
@@ -242,9 +242,6 @@ static int __init ab3100_rtc_probe(struct platform_device *pdev)
 
 static int __exit ab3100_rtc_remove(struct platform_device *pdev)
 {
-	struct rtc_device *rtc = platform_get_drvdata(pdev);
-
-	rtc_device_unregister(rtc);
 	platform_set_drvdata(pdev, NULL);
 	return 0;
 }
Signature · 1 line
1.7.2.5
author
#1 lore raw

PATCH 2/30 rtc: rtc-au1xxx: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-au1xxx.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/rtc/rtc-au1xxx.c +1 -4
index dfd6d66..7995abc 100644
@@ -101,7 +101,7 @@ static int au1xtoy_rtc_probe(struct platform_device *pdev)
 	while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S)
 		msleep(1);
 
-	rtcdev = rtc_device_register("rtc-au1xxx", &pdev->dev,
+	rtcdev = devm_rtc_device_register(&pdev->dev, "rtc-au1xxx",
 				     &au1xtoy_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtcdev)) {
 		ret = PTR_ERR(rtcdev);
@@ -118,9 +118,6 @@ out_err:
 
 static int au1xtoy_rtc_remove(struct platform_device *pdev)
 {
-	struct rtc_device *rtcdev = platform_get_drvdata(pdev);
-
-	rtc_device_unregister(rtcdev);
 	platform_set_drvdata(pdev, NULL);
 
 	return 0;
Signature · 1 line
1.7.2.5
author
#2 lore raw

PATCH 3/30 rtc: rtc-bq32k: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-bq32k.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/rtc/rtc-bq32k.c +1 -4
index 036cb89..fea78bc 100644
@@ -153,7 +153,7 @@ static int bq32k_probe(struct i2c_client *client,
 	if (error)
 		return error;
 
-	rtc = rtc_device_register(bq32k_driver.driver.name, &client->dev,
+	rtc = devm_rtc_device_register(&client->dev, bq32k_driver.driver.name,
 						&bq32k_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
@@ -165,9 +165,6 @@ static int bq32k_probe(struct i2c_client *client,
 
 static int bq32k_remove(struct i2c_client *client)
 {
-	struct rtc_device *rtc = i2c_get_clientdata(client);
-
-	rtc_device_unregister(rtc);
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#3 lore raw

PATCH 4/30 rtc: rtc-dm355evm: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-dm355evm.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/rtc/rtc-dm355evm.c +2 -5
index b2ed2c9..1e1ca63 100644
@@ -127,8 +127,8 @@ static int dm355evm_rtc_probe(struct platform_device *pdev)
 {
 	struct rtc_device *rtc;
 
-	rtc = rtc_device_register(pdev->name,
-				  &pdev->dev, &dm355evm_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
+					&dm355evm_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc)) {
 		dev_err(&pdev->dev, "can't register RTC device, err %ld\n",
 			PTR_ERR(rtc));
@@ -141,9 +141,6 @@ static int dm355evm_rtc_probe(struct platform_device *pdev)
 
 static int dm355evm_rtc_remove(struct platform_device *pdev)
 {
-	struct rtc_device *rtc = platform_get_drvdata(pdev);
-
-	rtc_device_unregister(rtc);
 	platform_set_drvdata(pdev, NULL);
 	return 0;
 }
Signature · 1 line
1.7.2.5
author
#4 lore raw

PATCH 5/30 rtc: rtc-ds1302: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-ds1302.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/rtc/rtc-ds1302.c +1 -4
index 7d4c2b4..d139543 100644
@@ -224,7 +224,7 @@ static int __init ds1302_rtc_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	rtc = rtc_device_register("ds1302", &pdev->dev,
+	rtc = devm_rtc_device_register(&pdev->dev, "ds1302",
 					   &ds1302_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
@@ -236,9 +236,6 @@ static int __init ds1302_rtc_probe(struct platform_device *pdev)
 
 static int __exit ds1302_rtc_remove(struct platform_device *pdev)
 {
-	struct rtc_device *rtc = platform_get_drvdata(pdev);
-
-	rtc_device_unregister(rtc);
 	platform_set_drvdata(pdev, NULL);
 
 	return 0;
Signature · 1 line
1.7.2.5
author
#5 lore raw

PATCH 6/30 rtc: rtc-ds1672: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-ds1672.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
drivers/rtc/rtc-ds1672.c +1 -7
index 45d65c0..3fc2a47 100644
@@ -155,11 +155,6 @@ static const struct rtc_class_ops ds1672_rtc_ops = {
 
 static int ds1672_remove(struct i2c_client *client)
 {
-	struct rtc_device *rtc = i2c_get_clientdata(client);
-
-	if (rtc)
-		rtc_device_unregister(rtc);
-
 	return 0;
 }
 
@@ -177,7 +172,7 @@ static int ds1672_probe(struct i2c_client *client,
 
 	dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n");
 
-	rtc = rtc_device_register(ds1672_driver.driver.name, &client->dev,
+	rtc = devm_rtc_device_register(&client->dev, ds1672_driver.driver.name,
 				  &ds1672_rtc_ops, THIS_MODULE);
 
 	if (IS_ERR(rtc))
@@ -202,7 +197,6 @@ static int ds1672_probe(struct i2c_client *client,
 	return 0;
 
  exit_devreg:
-	rtc_device_unregister(rtc);
 	return err;
 }
 
Signature · 1 line
1.7.2.5
author
#6 lore raw

PATCH 7/30 rtc: rtc-ds3234: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-ds3234.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/rtc/rtc-ds3234.c +2 -5
index 7a4495e..a66efd4 100644
@@ -146,8 +146,8 @@ static int ds3234_probe(struct spi_device *spi)
 	ds3234_get_reg(&spi->dev, DS3234_REG_CONT_STAT, &tmp);
 	dev_info(&spi->dev, "Ctrl/Stat Reg: 0x%02x\n", tmp);
 
-	rtc = rtc_device_register("ds3234",
-				&spi->dev, &ds3234_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&spi->dev, "ds3234",
+				&ds3234_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
@@ -158,9 +158,6 @@ static int ds3234_probe(struct spi_device *spi)
 
 static int ds3234_remove(struct spi_device *spi)
 {
-	struct rtc_device *rtc = spi_get_drvdata(spi);
-
-	rtc_device_unregister(rtc);
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#7 lore raw

PATCH 8/30 rtc: rtc-efi: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-efi.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
drivers/rtc/rtc-efi.c +1 -5
index e706662..b3c8c0b 100644
@@ -191,7 +191,7 @@ static int __init efi_rtc_probe(struct platform_device *dev)
 {
 	struct rtc_device *rtc;
 
-	rtc = rtc_device_register("rtc-efi", &dev->dev, &efi_rtc_ops,
+	rtc = devm_rtc_device_register(&dev->dev, "rtc-efi", &efi_rtc_ops,
 					THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
@@ -203,10 +203,6 @@ static int __init efi_rtc_probe(struct platform_device *dev)
 
 static int __exit efi_rtc_remove(struct platform_device *dev)
 {
-	struct rtc_device *rtc = platform_get_drvdata(dev);
-
-	rtc_device_unregister(rtc);
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#8 lore raw

PATCH 9/30 rtc: rtc-em3027: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-em3027.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
drivers/rtc/rtc-em3027.c +1 -6
index f6c24ce..3f9eb57 100644
@@ -121,7 +121,7 @@ static int em3027_probe(struct i2c_client *client,
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
 		return -ENODEV;
 
-	rtc = rtc_device_register(em3027_driver.driver.name, &client->dev,
+	rtc = devm_rtc_device_register(&client->dev, em3027_driver.driver.name,
 				  &em3027_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
@@ -133,11 +133,6 @@ static int em3027_probe(struct i2c_client *client,
 
 static int em3027_remove(struct i2c_client *client)
 {
-	struct rtc_device *rtc = i2c_get_clientdata(client);
-
-	if (rtc)
-		rtc_device_unregister(rtc);
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#9 lore raw

PATCH 10/30 rtc: rtc-generic: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-generic.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
drivers/rtc/rtc-generic.c +2 -6
index 0bf4530..06279ce 100644
@@ -38,8 +38,8 @@ static int __init generic_rtc_probe(struct platform_device *dev)
 {
 	struct rtc_device *rtc;
 
-	rtc = rtc_device_register("rtc-generic", &dev->dev, &generic_rtc_ops,
-				  THIS_MODULE);
+	rtc = devm_rtc_device_register(&dev->dev, "rtc-generic",
+					&generic_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
@@ -50,10 +50,6 @@ static int __init generic_rtc_probe(struct platform_device *dev)
 
 static int __exit generic_rtc_remove(struct platform_device *dev)
 {
-	struct rtc_device *rtc = platform_get_drvdata(dev);
-
-	rtc_device_unregister(rtc);
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#10 lore raw

PATCH 11/30 rtc: hid-sensor-time: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-hid-sensor-time.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/rtc/rtc-hid-sensor-time.c +3 -4
index 31c5728..6302450 100644
@@ -255,8 +255,9 @@ static int hid_time_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	time_state->rtc = rtc_device_register("hid-sensor-time",
-				&pdev->dev, &hid_time_rtc_ops, THIS_MODULE);
+	time_state->rtc = devm_rtc_device_register(&pdev->dev,
+					"hid-sensor-time", &hid_time_rtc_ops,
+					THIS_MODULE);
 
 	if (IS_ERR(time_state->rtc)) {
 		dev_err(&pdev->dev, "rtc device register failed!\n");
@@ -269,9 +270,7 @@ static int hid_time_probe(struct platform_device *pdev)
 static int hid_time_remove(struct platform_device *pdev)
 {
 	struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
-	struct hid_time_state *time_state = platform_get_drvdata(pdev);
 
-	rtc_device_unregister(time_state->rtc);
 	sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_TIME);
 
 	return 0;
Signature · 1 line
1.7.2.5
author
#11 lore raw

PATCH 12/30 rtc: rtc-ls1x: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-ls1x.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/rtc/rtc-ls1x.c +1 -4
index f59b634..db82f91 100644
@@ -172,7 +172,7 @@ static int ls1x_rtc_probe(struct platform_device *pdev)
 	while (readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_TTS)
 		usleep_range(1000, 3000);
 
-	rtcdev = rtc_device_register("ls1x-rtc", &pdev->dev,
+	rtcdev = devm_rtc_device_register(&pdev->dev, "ls1x-rtc",
 					&ls1x_rtc_ops , THIS_MODULE);
 	if (IS_ERR(rtcdev)) {
 		ret = PTR_ERR(rtcdev);
@@ -187,9 +187,6 @@ err:
 
 static int ls1x_rtc_remove(struct platform_device *pdev)
 {
-	struct rtc_device *rtcdev = platform_get_drvdata(pdev);
-
-	rtc_device_unregister(rtcdev);
 	platform_set_drvdata(pdev, NULL);
 
 	return 0;
Signature · 1 line
1.7.2.5
author
#12 lore raw

PATCH 13/30 rtc: rtc-m41t93: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-m41t93.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
drivers/rtc/rtc-m41t93.c +2 -7
index 4916968..cfc21a1 100644
@@ -184,8 +184,8 @@ static int m41t93_probe(struct spi_device *spi)
 		return -ENODEV;
 	}
 
-	rtc = rtc_device_register(m41t93_driver.driver.name,
-		&spi->dev, &m41t93_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&spi->dev, m41t93_driver.driver.name,
+					&m41t93_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
@@ -197,11 +197,6 @@ static int m41t93_probe(struct spi_device *spi)
 
 static int m41t93_remove(struct spi_device *spi)
 {
-	struct rtc_device *rtc = spi_get_drvdata(spi);
-
-	if (rtc)
-		rtc_device_unregister(rtc);
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#13 lore raw

PATCH 14/30 rtc: rtc-m41t94: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-m41t94.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
drivers/rtc/rtc-m41t94.c +2 -7
index 89266c6..cf655a9 100644
@@ -124,8 +124,8 @@ static int m41t94_probe(struct spi_device *spi)
 		return res;
 	}
 
-	rtc = rtc_device_register(m41t94_driver.driver.name,
-		&spi->dev, &m41t94_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&spi->dev, m41t94_driver.driver.name,
+					&m41t94_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
@@ -136,11 +136,6 @@ static int m41t94_probe(struct spi_device *spi)
 
 static int m41t94_remove(struct spi_device *spi)
 {
-	struct rtc_device *rtc = spi_get_drvdata(spi);
-
-	if (rtc)
-		rtc_device_unregister(rtc);
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#14 lore raw

PATCH 15/30 rtc: rtc-m48t86: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-m48t86.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
drivers/rtc/rtc-m48t86.c +4 -7
index 2ffbcac..33a91c4 100644
@@ -148,8 +148,10 @@ static int m48t86_rtc_probe(struct platform_device *dev)
 {
 	unsigned char reg;
 	struct m48t86_ops *ops = dev->dev.platform_data;
-	struct rtc_device *rtc = rtc_device_register("m48t86",
-				&dev->dev, &m48t86_rtc_ops, THIS_MODULE);
+	struct rtc_device *rtc;
+
+	rtc = devm_rtc_device_register(&dev->dev, "m48t86",
+				&m48t86_rtc_ops, THIS_MODULE);
 
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
@@ -166,11 +168,6 @@ static int m48t86_rtc_probe(struct platform_device *dev)
 
 static int m48t86_rtc_remove(struct platform_device *dev)
 {
-	struct rtc_device *rtc = platform_get_drvdata(dev);
-
- 	if (rtc)
-		rtc_device_unregister(rtc);
-
 	platform_set_drvdata(dev, NULL);
 
 	return 0;
Signature · 1 line
1.7.2.5
author
#15 lore raw

PATCH 16/30 rtc: rtc-max6900: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-max6900.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
drivers/rtc/rtc-max6900.c +2 -7
index a00e332..8669d6d 100644
@@ -214,11 +214,6 @@ static int max6900_rtc_set_time(struct device *dev, struct rtc_time *tm)
 
 static int max6900_remove(struct i2c_client *client)
 {
-	struct rtc_device *rtc = i2c_get_clientdata(client);
-
-	if (rtc)
-		rtc_device_unregister(rtc);
-
 	return 0;
 }
 
@@ -237,8 +232,8 @@ max6900_probe(struct i2c_client *client, const struct i2c_device_id *id)
 
 	dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n");
 
-	rtc = rtc_device_register(max6900_driver.driver.name,
-				  &client->dev, &max6900_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&client->dev, max6900_driver.driver.name,
+					&max6900_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
Signature · 1 line
1.7.2.5
author
#16 lore raw

PATCH 17/30 rtc: rtc-max6902: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-max6902.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/rtc/rtc-max6902.c +2 -5
index 7d0bf69..7e4491b 100644
@@ -134,8 +134,8 @@ static int max6902_probe(struct spi_device *spi)
 	if (res != 0)
 		return res;
 
-	rtc = rtc_device_register("max6902",
-				&spi->dev, &max6902_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&spi->dev, "max6902",
+				&max6902_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
@@ -145,9 +145,6 @@ static int max6902_probe(struct spi_device *spi)
 
 static int max6902_remove(struct spi_device *spi)
 {
-	struct rtc_device *rtc = dev_get_drvdata(&spi->dev);
-
-	rtc_device_unregister(rtc);
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#17 lore raw

PATCH 18/30 rtc: rtc-ps3: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-ps3.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/rtc/rtc-ps3.c +1 -2
index 846722d..4bb825b 100644
@@ -62,7 +62,7 @@ static int __init ps3_rtc_probe(struct platform_device *dev)
 {
 	struct rtc_device *rtc;
 
-	rtc = rtc_device_register("rtc-ps3", &dev->dev, &ps3_rtc_ops,
+	rtc = devm_rtc_device_register(&dev->dev, "rtc-ps3", &ps3_rtc_ops,
 				  THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
@@ -73,7 +73,6 @@ static int __init ps3_rtc_probe(struct platform_device *dev)
 
 static int __exit ps3_rtc_remove(struct platform_device *dev)
 {
-	rtc_device_unregister(platform_get_drvdata(dev));
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#18 lore raw

PATCH 19/30 rtc: rtc-r9701: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-r9701.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/rtc/rtc-r9701.c +2 -5
index 7726f4a..0adf5b5 100644
@@ -154,8 +154,8 @@ static int r9701_probe(struct spi_device *spi)
 		}
 	}
 
-	rtc = rtc_device_register("r9701",
-				&spi->dev, &r9701_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&spi->dev, "r9701",
+				&r9701_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
@@ -166,9 +166,6 @@ static int r9701_probe(struct spi_device *spi)
 
 static int r9701_remove(struct spi_device *spi)
 {
-	struct rtc_device *rtc = dev_get_drvdata(&spi->dev);
-
-	rtc_device_unregister(rtc);
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#19 lore raw

PATCH 20/30 rtc: rtc-rc5t583: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-rc5t583.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/rtc/rtc-rc5t583.c +1 -3
index eb3194d..518908d 100644
@@ -256,7 +256,7 @@ static int rc5t583_rtc_probe(struct platform_device *pdev)
 	}
 	device_init_wakeup(&pdev->dev, 1);
 
-	ricoh_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev,
+	ricoh_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
 		&rc5t583_rtc_ops, THIS_MODULE);
 	if (IS_ERR(ricoh_rtc->rtc)) {
 		ret = PTR_ERR(ricoh_rtc->rtc);
@@ -276,8 +276,6 @@ static int rc5t583_rtc_remove(struct platform_device *pdev)
 	struct rc5t583_rtc *rc5t583_rtc = dev_get_drvdata(&pdev->dev);
 
 	rc5t583_rtc_alarm_irq_enable(&rc5t583_rtc->rtc->dev, 0);
-
-	rtc_device_unregister(rc5t583_rtc->rtc);
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#20 lore raw

PATCH 21/30 rtc: rtc-rs5c313: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-rs5c313.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
drivers/rtc/rtc-rs5c313.c +1 -5
index d98ea5b..8089fc6 100644
@@ -367,7 +367,7 @@ static const struct rtc_class_ops rs5c313_rtc_ops = {
 
 static int rs5c313_rtc_probe(struct platform_device *pdev)
 {
-	struct rtc_device *rtc = rtc_device_register("rs5c313", &pdev->dev,
+	struct rtc_device *rtc = devm_rtc_device_register(&pdev->dev, "rs5c313",
 				&rs5c313_rtc_ops, THIS_MODULE);
 
 	if (IS_ERR(rtc))
@@ -380,10 +380,6 @@ static int rs5c313_rtc_probe(struct platform_device *pdev)
 
 static int rs5c313_rtc_remove(struct platform_device *pdev)
 {
-	struct rtc_device *rtc = platform_get_drvdata( pdev );
-
-	rtc_device_unregister(rtc);
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#21 lore raw

PATCH 22/30 rtc: rtc-rv3029c2: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-rv3029c2.c |   16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)
drivers/rtc/rtc-rv3029c2.c +3 -13
index f8ee8ad..5032c24 100644
@@ -395,9 +395,8 @@ static int rv3029c2_probe(struct i2c_client *client,
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_EMUL))
 		return -ENODEV;
 
-	rtc = rtc_device_register(client->name,
-				&client->dev, &rv3029c2_rtc_ops,
-				THIS_MODULE);
+	rtc = devm_rtc_device_register(&client->dev, client->name,
+					&rv3029c2_rtc_ops, THIS_MODULE);
 
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
@@ -407,23 +406,14 @@ static int rv3029c2_probe(struct i2c_client *client,
 	rc = rv3029c2_i2c_get_sr(client, buf);
 	if (rc < 0) {
 		dev_err(&client->dev, "reading status failed\n");
-		goto exit_unregister;
+		return rc;
 	}
 
 	return 0;
-
-exit_unregister:
-	rtc_device_unregister(rtc);
-
-	return rc;
 }
 
 static int rv3029c2_remove(struct i2c_client *client)
 {
-	struct rtc_device *rtc = i2c_get_clientdata(client);
-
-	rtc_device_unregister(rtc);
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#22 lore raw

PATCH 23/30 rtc: rtc-rx4581: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-rx4581.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/rtc/rtc-rx4581.c +2 -5
index 599ec73..d1b88db 100644
@@ -273,8 +273,8 @@ static int rx4581_probe(struct spi_device *spi)
 	if (res != 0)
 		return res;
 
-	rtc = rtc_device_register("rx4581",
-				&spi->dev, &rx4581_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&spi->dev, "rx4581",
+				&rx4581_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
@@ -284,9 +284,6 @@ static int rx4581_probe(struct spi_device *spi)
 
 static int rx4581_remove(struct spi_device *spi)
 {
-	struct rtc_device *rtc = dev_get_drvdata(&spi->dev);
-
-	rtc_device_unregister(rtc);
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#23 lore raw

PATCH 24/30 rtc: rtc-rx8581: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-rx8581.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
drivers/rtc/rtc-rx8581.c +2 -6
index b0c2726..07f3037 100644
@@ -240,8 +240,8 @@ static int rx8581_probe(struct i2c_client *client,
 
 	dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n");
 
-	rtc = rtc_device_register(rx8581_driver.driver.name,
-				&client->dev, &rx8581_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&client->dev, rx8581_driver.driver.name,
+					&rx8581_rtc_ops, THIS_MODULE);
 
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
@@ -253,10 +253,6 @@ static int rx8581_probe(struct i2c_client *client,
 
 static int rx8581_remove(struct i2c_client *client)
 {
-	struct rtc_device *rtc = i2c_get_clientdata(client);
-
-	rtc_device_unregister(rtc);
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#24 lore raw

PATCH 25/30 rtc: rtc-starfire: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-starfire.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
drivers/rtc/rtc-starfire.c +4 -6
index db7d076..987b5ec 100644
@@ -39,8 +39,10 @@ static const struct rtc_class_ops starfire_rtc_ops = {
 
 static int __init starfire_rtc_probe(struct platform_device *pdev)
 {
-	struct rtc_device *rtc = rtc_device_register("starfire", &pdev->dev,
-				     &starfire_rtc_ops, THIS_MODULE);
+	struct rtc_device *rtc;
+
+	rtc = devm_rtc_device_register(&pdev->dev, "starfire",
+				&starfire_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
@@ -51,10 +53,6 @@ static int __init starfire_rtc_probe(struct platform_device *pdev)
 
 static int __exit starfire_rtc_remove(struct platform_device *pdev)
 {
-	struct rtc_device *rtc = platform_get_drvdata(pdev);
-
-	rtc_device_unregister(rtc);
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#25 lore raw

PATCH 26/30 rtc: rtc-sun4v: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-sun4v.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/rtc/rtc-sun4v.c +4 -5
index 7c51c49..ce42e5f 100644
@@ -81,8 +81,10 @@ static const struct rtc_class_ops sun4v_rtc_ops = {
 
 static int __init sun4v_rtc_probe(struct platform_device *pdev)
 {
-	struct rtc_device *rtc = rtc_device_register("sun4v", &pdev->dev,
-				     &sun4v_rtc_ops, THIS_MODULE);
+	struct rtc_device *rtc;
+
+	rtc = devm_rtc_device_register(&pdev->dev, "sun4v",
+				&sun4v_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
 
@@ -92,9 +94,6 @@ static int __init sun4v_rtc_probe(struct platform_device *pdev)
 
 static int __exit sun4v_rtc_remove(struct platform_device *pdev)
 {
-	struct rtc_device *rtc = platform_get_drvdata(pdev);
-
-	rtc_device_unregister(rtc);
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#26 lore raw

PATCH 27/30 rtc: rtc-test: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-test.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
drivers/rtc/rtc-test.c +4 -6
index b92e0f6..7746e65 100644
@@ -99,8 +99,10 @@ static DEVICE_ATTR(irq, S_IRUGO | S_IWUSR, test_irq_show, test_irq_store);
 static int test_probe(struct platform_device *plat_dev)
 {
 	int err;
-	struct rtc_device *rtc = rtc_device_register("test", &plat_dev->dev,
-						&test_rtc_ops, THIS_MODULE);
+	struct rtc_device *rtc;
+
+	rtc = devm_rtc_device_register(&plat_dev->dev, "test",
+				&test_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc)) {
 		err = PTR_ERR(rtc);
 		return err;
@@ -115,15 +117,11 @@ static int test_probe(struct platform_device *plat_dev)
 	return 0;
 
 err:
-	rtc_device_unregister(rtc);
 	return err;
 }
 
 static int test_remove(struct platform_device *plat_dev)
 {
-	struct rtc_device *rtc = platform_get_drvdata(plat_dev);
-
-	rtc_device_unregister(rtc);
 	device_remove_file(&plat_dev->dev, &dev_attr_irq);
 
 	return 0;
Signature · 1 line
1.7.2.5
author
#27 lore raw

PATCH 28/30 rtc: rtc-tile: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-tile.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
drivers/rtc/rtc-tile.c +2 -7
index 62db484..249b653 100644
@@ -80,8 +80,8 @@ static int tile_rtc_probe(struct platform_device *dev)
 {
 	struct rtc_device *rtc;
 
-	rtc = rtc_device_register("tile",
-				  &dev->dev, &tile_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&dev->dev, "tile",
+				&tile_rtc_ops, THIS_MODULE);
 
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
@@ -96,11 +96,6 @@ static int tile_rtc_probe(struct platform_device *dev)
  */
 static int tile_rtc_remove(struct platform_device *dev)
 {
-	struct rtc_device *rtc = platform_get_drvdata(dev);
-
-	if (rtc)
-		rtc_device_unregister(rtc);
-
 	platform_set_drvdata(dev, NULL);
 
 	return 0;
Signature · 1 line
1.7.2.5
author
#28 lore raw

PATCH 29/30 rtc: rtc-wm8350: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-wm8350.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/rtc/rtc-wm8350.c +2 -5
index 8ad86ae..af81dd6 100644
@@ -439,8 +439,8 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	wm_rtc->rtc = rtc_device_register("wm8350", &pdev->dev,
-					  &wm8350_rtc_ops, THIS_MODULE);
+	wm_rtc->rtc = devm_rtc_device_register(&pdev->dev, "wm8350",
+					&wm8350_rtc_ops, THIS_MODULE);
 	if (IS_ERR(wm_rtc->rtc)) {
 		ret = PTR_ERR(wm_rtc->rtc);
 		dev_err(&pdev->dev, "failed to register RTC: %d\n", ret);
@@ -462,13 +462,10 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
 static int wm8350_rtc_remove(struct platform_device *pdev)
 {
 	struct wm8350 *wm8350 = platform_get_drvdata(pdev);
-	struct wm8350_rtc *wm_rtc = &wm8350->rtc;
 
 	wm8350_free_irq(wm8350, WM8350_IRQ_RTC_SEC, wm8350);
 	wm8350_free_irq(wm8350, WM8350_IRQ_RTC_ALM, wm8350);
 
-	rtc_device_unregister(wm_rtc->rtc);
-
 	return 0;
 }
 
Signature · 1 line
1.7.2.5
author
#29 lore raw

PATCH 30/30 rtc: rtc-x1205: use devm_rtc_device_register()

In reply to Jingoo Han

devm_rtc_device_register() is device managed and makes cleanup paths simpler.

---
 drivers/rtc/rtc-x1205.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)
drivers/rtc/rtc-x1205.c +3 -11
index f36e59c..fa9b067 100644
@@ -630,8 +630,8 @@ static int x1205_probe(struct i2c_client *client,
 
 	dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n");
 
-	rtc = rtc_device_register(x1205_driver.driver.name, &client->dev,
-				&x1205_rtc_ops, THIS_MODULE);
+	rtc = devm_rtc_device_register(&client->dev, x1205_driver.driver.name,
+					&x1205_rtc_ops, THIS_MODULE);
 
 	if (IS_ERR(rtc))
 		return PTR_ERR(rtc);
@@ -653,21 +653,13 @@ static int x1205_probe(struct i2c_client *client,
 
 	err = x1205_sysfs_register(&client->dev);
 	if (err)
-		goto exit_devreg;
+		return err;
 
 	return 0;
-
-exit_devreg:
-	rtc_device_unregister(rtc);
-
-	return err;
 }
 
 static int x1205_remove(struct i2c_client *client)
 {
-	struct rtc_device *rtc = i2c_get_clientdata(client);
-
-	rtc_device_unregister(rtc);
 	x1205_sysfs_unregister(&client->dev);
 	return 0;
 }
Signature · 1 line
1.7.2.5