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

rtc: rtc-davinci: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or
on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata
= NULL when no driver is bound"). Thus, it is not needed to manually
clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jingoo Han and committed by
Linus Torvalds
438831fc 37dd5ffc

+2 -9
+2 -9
drivers/rtc/rtc-davinci.c
··· 526 526 davinci_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, 527 527 &davinci_rtc_ops, THIS_MODULE); 528 528 if (IS_ERR(davinci_rtc->rtc)) { 529 - ret = PTR_ERR(davinci_rtc->rtc); 530 529 dev_err(dev, "unable to register RTC device, err %d\n", 531 530 ret); 532 - goto fail1; 531 + return PTR_ERR(davinci_rtc->rtc); 533 532 } 534 533 535 534 rtcif_write(davinci_rtc, PRTCIF_INTFLG_RTCSS, PRTCIF_INTFLG); ··· 542 543 0, "davinci_rtc", davinci_rtc); 543 544 if (ret < 0) { 544 545 dev_err(dev, "unable to register davinci RTC interrupt\n"); 545 - goto fail1; 546 + return ret; 546 547 } 547 548 548 549 /* Enable interrupts */ ··· 555 556 device_init_wakeup(&pdev->dev, 0); 556 557 557 558 return 0; 558 - 559 - fail1: 560 - platform_set_drvdata(pdev, NULL); 561 - return ret; 562 559 } 563 560 564 561 static int __exit davinci_rtc_remove(struct platform_device *pdev) ··· 564 569 device_init_wakeup(&pdev->dev, 0); 565 570 566 571 rtcif_write(davinci_rtc, 0, PRTCIF_INTEN); 567 - 568 - platform_set_drvdata(pdev, NULL); 569 572 570 573 return 0; 571 574 }