aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-max6900.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-max6900.c')
-rw-r--r--drivers/rtc/rtc-max6900.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-max6900.c b/drivers/rtc/rtc-max6900.c
index a00e33204b91..8669d6d09a00 100644
--- a/drivers/rtc/rtc-max6900.c
+++ b/drivers/rtc/rtc-max6900.c
@@ -214,11 +214,6 @@ static int max6900_rtc_set_time(struct device *dev, struct rtc_time *tm)
214 214
215static int max6900_remove(struct i2c_client *client) 215static int max6900_remove(struct i2c_client *client)
216{ 216{
217 struct rtc_device *rtc = i2c_get_clientdata(client);
218
219 if (rtc)
220 rtc_device_unregister(rtc);
221
222 return 0; 217 return 0;
223} 218}
224 219
@@ -237,8 +232,8 @@ max6900_probe(struct i2c_client *client, const struct i2c_device_id *id)
237 232
238 dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n"); 233 dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n");
239 234
240 rtc = rtc_device_register(max6900_driver.driver.name, 235 rtc = devm_rtc_device_register(&client->dev, max6900_driver.driver.name,
241 &client->dev, &max6900_rtc_ops, THIS_MODULE); 236 &max6900_rtc_ops, THIS_MODULE);
242 if (IS_ERR(rtc)) 237 if (IS_ERR(rtc))
243 return PTR_ERR(rtc); 238 return PTR_ERR(rtc);
244 239