Re: [PATCH 2/4] input: keyboard/mouse/touchscreen/misc: Use dev_get_drvdata()

From
Lothar Waßmann <hidden>
Date
2019-07-02 12:39:35
Also in
linux-arm-kernel, linux-tegra, lkml
Reply to
Fuqian Huang, 2019-07-02
Hi,

On Tue, 2 Jul 2019 19:47:16 +0800 Fuqian Huang wrote:
Andy Shevchenko [off-list ref] 於 2019年7月2日週二 下午5:51寫道:
quoted
On Tue, Jul 2, 2019 at 11:20 AM Fuqian Huang [off-list ref] wrote:  
quoted
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.


Lothar Waßmann

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (8 messages) 8 messages, 5 authors, last reply 2019-07-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help