rtc: ds1347: convert to devm_rtc_allocate_device
This allows further improvement of the driver. Link: https://lore.kernel.org/r/20191007134724.15505-6-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
088443c79c
commit
554692d56d
|
@ -129,13 +129,13 @@ static int ds1347_probe(struct spi_device *spi)
|
||||||
data = data & 0x1B;
|
data = data & 0x1B;
|
||||||
regmap_write(map, DS1347_STATUS_REG, data);
|
regmap_write(map, DS1347_STATUS_REG, data);
|
||||||
|
|
||||||
rtc = devm_rtc_device_register(&spi->dev, "ds1347",
|
rtc = devm_rtc_allocate_device(&spi->dev);
|
||||||
&ds1347_rtc_ops, THIS_MODULE);
|
|
||||||
|
|
||||||
if (IS_ERR(rtc))
|
if (IS_ERR(rtc))
|
||||||
return PTR_ERR(rtc);
|
return PTR_ERR(rtc);
|
||||||
|
|
||||||
return 0;
|
rtc->ops = &ds1347_rtc_ops;
|
||||||
|
|
||||||
|
return rtc_register_device(rtc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct spi_driver ds1347_driver = {
|
static struct spi_driver ds1347_driver = {
|
||||||
|
|
Loading…
Reference in New Issue