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: amlogic-a4: simplify probe

Use devm_device_init_wakeup to simplify probe and remove .remove as it is now
empty.

Also remove the unnecessary error string as there are no error path without an
error message in devm_rtc_register_device.

Reviewed-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Link: https://patch.msgid.link/20251031204724.756857-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

+5 -23
+5 -23
drivers/rtc/rtc-amlogic-a4.c
··· 361 361 "failed to get_enable rtc sys clk\n"); 362 362 aml_rtc_init(rtc); 363 363 364 - device_init_wakeup(dev, true); 364 + devm_device_init_wakeup(dev); 365 365 platform_set_drvdata(pdev, rtc); 366 366 367 367 rtc->rtc_dev = devm_rtc_allocate_device(dev); 368 - if (IS_ERR(rtc->rtc_dev)) { 369 - ret = PTR_ERR(rtc->rtc_dev); 370 - goto err_clk; 371 - } 368 + if (IS_ERR(rtc->rtc_dev)) 369 + return PTR_ERR(rtc->rtc_dev); 372 370 373 371 ret = devm_request_irq(dev, rtc->irq, aml_rtc_handler, 374 372 IRQF_ONESHOT, "aml-rtc alarm", rtc); 375 373 if (ret) { 376 374 dev_err_probe(dev, ret, "IRQ%d request failed, ret = %d\n", 377 375 rtc->irq, ret); 378 - goto err_clk; 376 + return ret; 379 377 } 380 378 381 379 rtc->rtc_dev->ops = &aml_rtc_ops; 382 380 rtc->rtc_dev->range_min = 0; 383 381 rtc->rtc_dev->range_max = U32_MAX; 384 382 385 - ret = devm_rtc_register_device(rtc->rtc_dev); 386 - if (ret) { 387 - dev_err_probe(&pdev->dev, ret, "Failed to register RTC device: %d\n", ret); 388 - goto err_clk; 389 - } 390 - 391 - return 0; 392 - err_clk: 393 - device_init_wakeup(dev, false); 394 - 395 - return ret; 383 + return devm_rtc_register_device(rtc->rtc_dev); 396 384 } 397 385 398 386 #ifdef CONFIG_PM_SLEEP ··· 408 420 static SIMPLE_DEV_PM_OPS(aml_rtc_pm_ops, 409 421 aml_rtc_suspend, aml_rtc_resume); 410 422 411 - static void aml_rtc_remove(struct platform_device *pdev) 412 - { 413 - device_init_wakeup(&pdev->dev, false); 414 - } 415 - 416 423 static const struct aml_rtc_config a5_rtc_config = { 417 424 }; 418 425 ··· 430 447 431 448 static struct platform_driver aml_rtc_driver = { 432 449 .probe = aml_rtc_probe, 433 - .remove = aml_rtc_remove, 434 450 .driver = { 435 451 .name = "aml-rtc", 436 452 .pm = &aml_rtc_pm_ops,