linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: "Lothar Waßmann" <LW@KARO-electronics.de>
Cc: Fuqian Huang <huangfq.daxian@gmail.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Tony Lindgren <tony@atomide.com>,
	Richard Fontana <rfontana@redhat.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Fabio Estevam <festevam@gmail.com>, Rob Herring <robh@kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Anson Huang <anson.huang@nxp.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Luca Weiss <luca@z3ntu.xyz>, NXP Linux Team <linux-imx@nxp.com>,
	Sylvain Lemieux <slemieux.tyco@gmail.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Brian Masney <masneyb@onstation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	linux-input <linux-input@vger.kernel.org>,
	Vladimir
Subject: Re: [PATCH 2/4] input: keyboard/mouse/touchscreen/misc: Use dev_get_drvdata()
Date: Wed, 3 Jul 2019 07:17:46 +0100	[thread overview]
Message-ID: <20190703061746.GI4652@dell> (raw)
In-Reply-To: <20190702143225.12b0fe07@karo-electronics.de>

On Tue, 02 Jul 2019, Lothar Waßmann wrote:

> Hi,
> 
> On Tue, 2 Jul 2019 19:47:16 +0800 Fuqian Huang 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).
> > 
> Did you check whether the compiler generates different (better) code
> with and without your patch? My guess is it won't.

I can see Fuqian's point.  If bus APIs are preferred, maybe it would
be nicer if the function was adapted to accept a platform_device
instead?

Caveat: I haven't taken the time to look into the call-site details.
	This comment is based on just the patch alone.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2019-07-03  6:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01  3:23 [PATCH 2/4] input: keyboard/mouse/touchscreen/misc: Use dev_get_drvdata() Fuqian Huang
2019-07-01  7:52 ` Dmitry Torokhov
2019-07-02  8:18   ` Fuqian Huang
2019-07-02  9:51     ` Andy Shevchenko
2019-07-02 11:47       ` Fuqian Huang
2019-07-02 12:32         ` Lothar Waßmann
2019-07-03  6:17           ` Lee Jones [this message]
2019-07-02 12:34         ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190703061746.GI4652@dell \
    --to=lee.jones@linaro.org \
    --cc=LW@KARO-electronics.de \
    --cc=andy.shevchenko@gmail.com \
    --cc=anson.huang@nxp.com \
    --cc=arnd@arndb.de \
    --cc=dan.carpenter@oracle.com \
    --cc=f.fainelli@gmail.com \
    --cc=festevam@gmail.com \
    --cc=huangfq.daxian@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-input@vger.kernel.org \
    --cc=luca@z3ntu.xyz \
    --cc=masneyb@onstation.org \
    --cc=rfontana@redhat.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=slemieux.tyco@gmail.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).