lkml.org 
[lkml]   [2019]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/4] input: keyboard/mouse/touchscreen/misc: Use dev_get_drvdata()
On Tue, Jul 2, 2019 at 2:47 PM Fuqian Huang <huangfq.daxian@gmail.com> wrote:
>
> Andy Shevchenko <andy.shevchenko@gmail.com> 於 2019年7月2日週二 下午5:51寫道:
> >
> > On Tue, Jul 2, 2019 at 11:20 AM Fuqian Huang <huangfq.daxian@gmail.com> wrote:
> > >
> > > I am not an expert on this. I just write a coccinelle script to search
> > > this kind of misuse and fix it in a naive way.
> > > Could you tell me about how to use the proper bus accessors? Then I
> > > will fix it up and resend a v2 patch set.
> >
> > First, don't top post.
> > And answering to this, simple drop the patch.
> > Proper bus accessors is exactly what it's used in the current code.
>
> But why not use dev_get_drvdata directly.
> It simplifies getting the 'driver_data' from 'struct device' directly.
> And the platform_device here is not required.
> Replace it can remove the unnecessary step back and forth. (dev -> pdev -> dev).

Like just now Lothar gives a good idea for you to sell is to check
compiler output.

But the question itself is addressed to subsystem maintainer.

> Just like the commit

> 1948d498dcf6("thermal: intel: int340x: processor_thermal_device:
> simplify to get driver data")

Side note: this example is not good, since the macro is bus agnostic.

> and many other similar commits in the Linux git log.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2019-07-02 14:35    [W:0.053 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site