diff options
Diffstat (limited to 'drivers/rtc/rtc-sh.c')
-rw-r--r-- | drivers/rtc/rtc-sh.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 4e8ab370ce63..4f98543d1ea5 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c @@ -359,8 +359,7 @@ static int sh_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm) { - struct platform_device *pdev = to_platform_device(dev); - struct sh_rtc *rtc = platform_get_drvdata(pdev); + struct sh_rtc *rtc = dev_get_drvdata(dev); unsigned int sec128, sec2, yr, yr100, cf_bit; do { @@ -419,8 +418,7 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm) static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm) { - struct platform_device *pdev = to_platform_device(dev); - struct sh_rtc *rtc = platform_get_drvdata(pdev); + struct sh_rtc *rtc = dev_get_drvdata(dev); unsigned int tmp; int year; @@ -475,8 +473,7 @@ static inline int sh_rtc_read_alarm_value(struct sh_rtc *rtc, int reg_off) static int sh_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) { - struct platform_device *pdev = to_platform_device(dev); - struct sh_rtc *rtc = platform_get_drvdata(pdev); + struct sh_rtc *rtc = dev_get_drvdata(dev); struct rtc_time *tm = &wkalrm->time; spin_lock_irq(&rtc->lock); @@ -509,8 +506,7 @@ static inline void sh_rtc_write_alarm_value(struct sh_rtc *rtc, static int sh_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm) { - struct platform_device *pdev = to_platform_device(dev); - struct sh_rtc *rtc = platform_get_drvdata(pdev); + struct sh_rtc *rtc = dev_get_drvdata(dev); unsigned int rcr1; struct rtc_time *tm = &wkalrm->time; int mon; @@ -723,8 +719,7 @@ static int __exit sh_rtc_remove(struct platform_device *pdev) static void sh_rtc_set_irq_wake(struct device *dev, int enabled) { - struct platform_device *pdev = to_platform_device(dev); - struct sh_rtc *rtc = platform_get_drvdata(pdev); + struct sh_rtc *rtc = dev_get_drvdata(dev); irq_set_irq_wake(rtc->periodic_irq, enabled); |