aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ds3234.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-ds3234.c')
-rw-r--r--drivers/rtc/rtc-ds3234.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-ds3234.c b/drivers/rtc/rtc-ds3234.c
index 7a4495ef1c39..ba98c0e9580d 100644
--- a/drivers/rtc/rtc-ds3234.c
+++ b/drivers/rtc/rtc-ds3234.c
@@ -146,21 +146,18 @@ static int ds3234_probe(struct spi_device *spi)
146 ds3234_get_reg(&spi->dev, DS3234_REG_CONT_STAT, &tmp); 146 ds3234_get_reg(&spi->dev, DS3234_REG_CONT_STAT, &tmp);
147 dev_info(&spi->dev, "Ctrl/Stat Reg: 0x%02x\n", tmp); 147 dev_info(&spi->dev, "Ctrl/Stat Reg: 0x%02x\n", tmp);
148 148
149 rtc = rtc_device_register("ds3234", 149 rtc = devm_rtc_device_register(&spi->dev, "ds3234",
150 &spi->dev, &ds3234_rtc_ops, THIS_MODULE); 150 &ds3234_rtc_ops, THIS_MODULE);
151 if (IS_ERR(rtc)) 151 if (IS_ERR(rtc))
152 return PTR_ERR(rtc); 152 return PTR_ERR(rtc);
153 153
154 dev_set_drvdata(&spi->dev, rtc); 154 spi_set_drvdata(spi, rtc);
155 155
156 return 0; 156 return 0;
157} 157}
158 158
159static int ds3234_remove(struct spi_device *spi) 159static int ds3234_remove(struct spi_device *spi)
160{ 160{
161 struct rtc_device *rtc = spi_get_drvdata(spi);
162
163 rtc_device_unregister(rtc);
164 return 0; 161 return 0;
165} 162}
166 163