aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-rv3029c2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-rv3029c2.c')
-rw-r--r--drivers/rtc/rtc-rv3029c2.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c
index f8ee8ad7825..e9ac5a43be1 100644
--- a/drivers/rtc/rtc-rv3029c2.c
+++ b/drivers/rtc/rtc-rv3029c2.c
@@ -310,7 +310,7 @@ static int rv3029c2_rtc_i2c_set_alarm(struct i2c_client *client,
dev_dbg(&client->dev, "alarm IRQ armed\n");
} else {
/* disable AIE irq */
- ret = rv3029c2_rtc_i2c_alarm_set_irq(client, 1);
+ ret = rv3029c2_rtc_i2c_alarm_set_irq(client, 0);
if (ret)
return ret;
@@ -395,34 +395,19 @@ 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);
-
- if (IS_ERR(rtc))
- return PTR_ERR(rtc);
-
- i2c_set_clientdata(client, rtc);
-
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;
+ rtc = devm_rtc_device_register(&client->dev, client->name,
+ &rv3029c2_rtc_ops, THIS_MODULE);
-exit_unregister:
- rtc_device_unregister(rtc);
-
- return rc;
-}
-
-static int rv3029c2_remove(struct i2c_client *client)
-{
- struct rtc_device *rtc = i2c_get_clientdata(client);
+ if (IS_ERR(rtc))
+ return PTR_ERR(rtc);
- rtc_device_unregister(rtc);
+ i2c_set_clientdata(client, rtc);
return 0;
}
@@ -432,7 +417,6 @@ static struct i2c_driver rv3029c2_driver = {
.name = "rtc-rv3029c2",
},
.probe = rv3029c2_probe,
- .remove = rv3029c2_remove,
.id_table = rv3029c2_id,
};