public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro•org>
To: "Lothar Waßmann" <LW@KARO-electronics•de>
Cc: 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>,
	Andy Shevchenko <andy.shevchenko@gmail•com>,
	NXP Linux Team <linux-imx@nxp•com>,
	linux-input <linux-input@vger•kernel.org>,
	Fuqian Huang <huangfq.daxian@gmail•com>,
	Dan Carpenter <dan.carpenter@oracle•com>,
	Brian Masney <masneyb@onstation•org>,
	Arnd Bergmann <arnd@arndb•de>,
	Sascha Hauer <s.hauer@pengutronix•de>,
	Sylvain Lemieux <slemieux.tyco@gmail•com>,
	Vladimir Zapolskiy <vz@mleia•com>,
	Alexios Zavras <alexios.zavras@intel•com>,
	linux-tegra@vger•kernel.org, Thomas Gleixner <tglx@linutronix•de>,
	Andy Shevchenko <andriy.shevchenko@linux•intel.com>,
	Allison Randal <allison@lohutok•net>,
	linux-arm Mailing List <linux-arm-kernel@lists•infradead.org>,
	Enrico Weigelt <info@metux•net>,
	Pascal PAILLET-LME <p.paillet@st•com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
	Dmitry Torokhov <dmitry.torokhov@gmail•com>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	H Hartley Sweeten <hsweeten@visionengravers•com>,
	Thierry Reding <thierry.reding@gmail•com>,
	Pengutronix Kernel Team <kernel@pengutronix•de>,
	Olof Johansson <olof@lixom•net>,
	Christian Hoff <christian_hoff@gmx•net>,
	Shawn Guo <shawnguo@kernel•org>,
	Gabriel Fernandez <gabriel.fernandez@st•com>
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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-07-03  6:18 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$(echo .)org \
    --cc=LW@KARO-electronics$(echo .)de \
    --cc=alexios.zavras@intel$(echo .)com \
    --cc=allison@lohutok$(echo .)net \
    --cc=andriy.shevchenko@linux$(echo .)intel.com \
    --cc=andy.shevchenko@gmail$(echo .)com \
    --cc=anson.huang@nxp$(echo .)com \
    --cc=arnd@arndb$(echo .)de \
    --cc=christian_hoff@gmx$(echo .)net \
    --cc=dan.carpenter@oracle$(echo .)com \
    --cc=dmitry.torokhov@gmail$(echo .)com \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=festevam@gmail$(echo .)com \
    --cc=gabriel.fernandez@st$(echo .)com \
    --cc=gregkh@linuxfoundation$(echo .)org \
    --cc=hsweeten@visionengravers$(echo .)com \
    --cc=huangfq.daxian@gmail$(echo .)com \
    --cc=info@metux$(echo .)net \
    --cc=jonathanh@nvidia$(echo .)com \
    --cc=kernel@pengutronix$(echo .)de \
    --cc=kstewart@linuxfoundation$(echo .)org \
    --cc=ldewangan@nvidia$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-imx@nxp$(echo .)com \
    --cc=linux-input@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-tegra@vger$(echo .)kernel.org \
    --cc=luca@z3ntu$(echo .)xyz \
    --cc=masneyb@onstation$(echo .)org \
    --cc=olof@lixom$(echo .)net \
    --cc=p.paillet@st$(echo .)com \
    --cc=rfontana@redhat$(echo .)com \
    --cc=robh@kernel$(echo .)org \
    --cc=s.hauer@pengutronix$(echo .)de \
    --cc=shawnguo@kernel$(echo .)org \
    --cc=slemieux.tyco@gmail$(echo .)com \
    --cc=tglx@linutronix$(echo .)de \
    --cc=thierry.reding@gmail$(echo .)com \
    --cc=tony@atomide$(echo .)com \
    --cc=vz@mleia$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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