Message ID | 20181021200042.1993-2-wsa+renesas@sang-engineering.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | rtc: simplify getting .driver_data | expand |
On 21/10/2018 22:00:41+0200, Wolfram Sang wrote: > We should get 'driver_data' 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> > --- > > Build tested only. buildbot is happy. > > drivers/rtc/rtc-ds1685.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > Applied, thanks.
On 22/10/2018 17:53:35+0200, Alexandre Belloni wrote: > On 21/10/2018 22:00:41+0200, Wolfram Sang wrote: > > We should get 'driver_data' 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> > > --- > > > > Build tested only. buildbot is happy. > > > > drivers/rtc/rtc-ds1685.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > Applied, thanks. > By the way, is there any reason why this was not part of your patch back in April? I had a deja vu feeling ;)
> By the way, is there any reason why this was not part of your patch back > in April? I had a deja vu feeling ;) I haven't checked but I guess the driver looked different back then. I didn't update the rule, so it should have matched back then, too.
diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c index b0723025ac31..2710f2594c42 100644 --- a/drivers/rtc/rtc-ds1685.c +++ b/drivers/rtc/rtc-ds1685.c @@ -778,8 +778,7 @@ static const char *ds1685_rtc_sqw_freq[16] = { static int ds1685_rtc_proc(struct device *dev, struct seq_file *seq) { - struct platform_device *pdev = to_platform_device(dev); - struct ds1685_priv *rtc = platform_get_drvdata(pdev); + struct ds1685_priv *rtc = dev_get_drvdata(dev); u8 ctrla, ctrlb, ctrlc, ctrld, ctrl4a, ctrl4b, ssn[8]; char *model;
We should get 'driver_data' 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> --- Build tested only. buildbot is happy. drivers/rtc/rtc-ds1685.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)