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
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user