rtc: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Michal Simek <michal.simek@xilinx.com> (for zynqmp) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:

committed by
Alexandre Belloni

parent
36d91a4d40
commit
85368bb9de
@@ -278,10 +278,9 @@ static int xlnx_rtc_remove(struct platform_device *pdev)
|
||||
|
||||
static int __maybe_unused xlnx_rtc_suspend(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct xlnx_rtc_dev *xrtcdev = platform_get_drvdata(pdev);
|
||||
struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
|
||||
|
||||
if (device_may_wakeup(&pdev->dev))
|
||||
if (device_may_wakeup(dev))
|
||||
enable_irq_wake(xrtcdev->alarm_irq);
|
||||
else
|
||||
xlnx_rtc_alarm_irq_enable(dev, 0);
|
||||
@@ -291,10 +290,9 @@ static int __maybe_unused xlnx_rtc_suspend(struct device *dev)
|
||||
|
||||
static int __maybe_unused xlnx_rtc_resume(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct xlnx_rtc_dev *xrtcdev = platform_get_drvdata(pdev);
|
||||
struct xlnx_rtc_dev *xrtcdev = dev_get_drvdata(dev);
|
||||
|
||||
if (device_may_wakeup(&pdev->dev))
|
||||
if (device_may_wakeup(dev))
|
||||
disable_irq_wake(xrtcdev->alarm_irq);
|
||||
else
|
||||
xlnx_rtc_alarm_irq_enable(dev, 1);
|
||||
|
Reference in New Issue
Block a user