mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
rtc: ds1343: switch to rtc_register_device
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
b5086150a6
commit
1536f6dc9d
1 changed files with 8 additions and 5 deletions
|
@ -642,12 +642,15 @@ static int ds1343_probe(struct spi_device *spi)
|
|||
data &= ~(DS1343_OSF | DS1343_IRQF1 | DS1343_IRQF0);
|
||||
regmap_write(priv->map, DS1343_STATUS_REG, data);
|
||||
|
||||
priv->rtc = devm_rtc_device_register(&spi->dev, "ds1343",
|
||||
&ds1343_rtc_ops, THIS_MODULE);
|
||||
if (IS_ERR(priv->rtc)) {
|
||||
dev_err(&spi->dev, "unable to register rtc ds1343\n");
|
||||
priv->rtc = devm_rtc_allocate_device(&spi->dev);
|
||||
if (IS_ERR(priv->rtc))
|
||||
return PTR_ERR(priv->rtc);
|
||||
}
|
||||
|
||||
priv->rtc->ops = &ds1343_rtc_ops;
|
||||
|
||||
res = rtc_register_device(priv->rtc);
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
priv->irq = spi->irq;
|
||||
|
||||
|
|
Loading…
Reference in a new issue