[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190703061746.GI4652@dell>
Date: Wed, 3 Jul 2019 07:17:46 +0100
From: Lee Jones <lee.jones@...aro.org>
To: Lothar Waßmann <LW@...O-electronics.de>
Cc: Fuqian Huang <huangfq.daxian@...il.com>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Kate Stewart <kstewart@...uxfoundation.org>,
Tony Lindgren <tony@...mide.com>,
Richard Fontana <rfontana@...hat.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Fabio Estevam <festevam@...il.com>,
Rob Herring <robh@...nel.org>,
Florian Fainelli <f.fainelli@...il.com>,
Anson Huang <anson.huang@....com>,
Jonathan Hunter <jonathanh@...dia.com>,
Luca Weiss <luca@...tu.xyz>,
NXP Linux Team <linux-imx@....com>,
Sylvain Lemieux <slemieux.tyco@...il.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Brian Masney <masneyb@...tation.org>,
Arnd Bergmann <arnd@...db.de>,
Sascha Hauer <s.hauer@...gutronix.de>,
linux-input <linux-input@...r.kernel.org>,
Vladimir Zapolskiy <vz@...ia.com>,
Alexios Zavras <alexios.zavras@...el.com>,
linux-tegra@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Allison Randal <allison@...utok.net>,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
Pascal PAILLET-LME <p.paillet@...com>,
Shawn Guo <shawnguo@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
H Hartley Sweeten <hsweeten@...ionengravers.com>,
Thierry Reding <thierry.reding@...il.com>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Olof Johansson <olof@...om.net>,
Christian Hoff <christian_hoff@....net>,
Enrico Weigelt <info@...ux.net>,
Gabriel Fernandez <gabriel.fernandez@...com>
Subject: Re: [PATCH 2/4] input: keyboard/mouse/touchscreen/misc: Use
dev_get_drvdata()
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@...il.com> 於 2019年7月2日週二 下午5:51寫道:
> > >
> > > On Tue, Jul 2, 2019 at 11:20 AM Fuqian Huang <huangfq.daxian@...il.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
Powered by blists - more mailing lists