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

Configure Feed

Select the types of activity you want to include in your feed.

rtc: spear: switch to devm_rtc_allocate_device

Switch to devm_rtc_allocate_device/devm_rtc_register_device, this allows
for further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20220309162301.61679-18-alexandre.belloni@bootlin.com

+9 -9
+9 -9
drivers/rtc/rtc-spear.c
··· 352 352 if (!config) 353 353 return -ENOMEM; 354 354 355 + config->rtc = devm_rtc_allocate_device(&pdev->dev); 356 + if (IS_ERR(config->rtc)) 357 + return PTR_ERR(config->rtc); 358 + 355 359 /* alarm irqs */ 356 360 irq = platform_get_irq(pdev, 0); 357 361 if (irq < 0) ··· 384 380 spin_lock_init(&config->lock); 385 381 platform_set_drvdata(pdev, config); 386 382 387 - config->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, 388 - &spear_rtc_ops, THIS_MODULE); 389 - if (IS_ERR(config->rtc)) { 390 - dev_err(&pdev->dev, "can't register RTC device, err %ld\n", 391 - PTR_ERR(config->rtc)); 392 - status = PTR_ERR(config->rtc); 393 - goto err_disable_clock; 394 - } 395 - 383 + config->rtc->ops = &spear_rtc_ops; 396 384 config->rtc->uie_unsupported = 1; 385 + 386 + status = devm_rtc_register_device(config->rtc); 387 + if (status) 388 + goto err_disable_clock; 397 389 398 390 if (!device_can_wakeup(&pdev->dev)) 399 391 device_init_wakeup(&pdev->dev, 1);