Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: mc13xxx: set range

All supported PMICs have a 15 bits days counter and hours, minutes, seconds

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

+10 -2
+10 -2
drivers/rtc/rtc-mc13xxx.c
··· 285 285 priv->mc13xxx = mc13xxx; 286 286 priv->valid = 1; 287 287 288 + priv->rtc = devm_rtc_allocate_device(&pdev->dev); 289 + if (IS_ERR(priv->rtc)) 290 + return PTR_ERR(priv->rtc); 288 291 platform_set_drvdata(pdev, priv); 292 + 293 + priv->rtc->ops = &mc13xxx_rtc_ops; 294 + /* 15bit days + hours, minutes, seconds */ 295 + priv->rtc->range_max = (timeu64_t)(1 << 15) * SEC_PER_DAY - 1; 289 296 290 297 mc13xxx_lock(mc13xxx); 291 298 ··· 310 303 311 304 mc13xxx_unlock(mc13xxx); 312 305 313 - priv->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, 314 - &mc13xxx_rtc_ops, THIS_MODULE); 306 + ret = rtc_register_device(priv->rtc); 307 + if (ret) 308 + goto err_irq_request; 315 309 316 310 return 0; 317 311