From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=FROM_EXCESS_BASE64, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94D02C06510 for ; Tue, 2 Jul 2019 12:39:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 73990208C4 for ; Tue, 2 Jul 2019 12:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727059AbfGBMjd convert rfc822-to-8bit (ORCPT ); Tue, 2 Jul 2019 08:39:33 -0400 Received: from mailout02.agenturserver.de ([185.15.192.33]:38720 "EHLO mailout02.agenturserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbfGBMjd (ORCPT ); Tue, 2 Jul 2019 08:39:33 -0400 X-Greylist: delayed 409 seconds by postgrey-1.27 at vger.kernel.org; Tue, 02 Jul 2019 08:39:30 EDT Received: from mail02.agenturserver.de (mail02.internal [172.16.51.35]) by mailout02.agenturserver.de (Postfix) with ESMTP id 64F3112614C; Tue, 2 Jul 2019 14:32:38 +0200 (CEST) Received: from localhost (ac02.internal [172.16.51.82]) by mail02.agenturserver.de (Postfix) with ESMTP id 1818180753; Tue, 2 Jul 2019 14:32:37 +0200 (CEST) Received: from mail.agenturserver.de ([172.16.51.35]) by localhost (ac02.mittwald.de [172.16.51.82]) (amavisd-new, port 10026) with ESMTP id wKItvphULAwB; Tue, 2 Jul 2019 14:32:36 +0200 (CEST) Received: from karo-electronics.de (unknown [89.1.81.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lw@karo-electronics.de) by mail.agenturserver.de (Postfix) with ESMTPSA; Tue, 2 Jul 2019 14:32:26 +0200 (CEST) Date: Tue, 2 Jul 2019 14:32:25 +0200 From: Lothar =?UTF-8?B?V2HDn21hbm4=?= To: Fuqian Huang Cc: Andy Shevchenko , Kate Stewart , Tony Lindgren , Richard Fontana , Laxman Dewangan , Fabio Estevam , Rob Herring , Florian Fainelli , Anson Huang , Lee Jones , Jonathan Hunter , Luca Weiss , NXP Linux Team , Sylvain Lemieux , Dan Carpenter , Brian Masney , Arnd Bergmann , Sascha Hauer , linux-input , Vladimir Zapolskiy , Alexios Zavras , linux-tegra@vger.kernel.org, Thomas Gleixner , Andy Shevchenko , Allison Randal , linux-arm Mailing List , Pascal PAILLET-LME , Shawn Guo , Dmitry Torokhov , Linux Kernel Mailing List , H Hartley Sweeten , Thierry Reding , Pengutronix Kernel Team , Greg Kroah-Hartman , Olof Johansson , Christian Hoff , Enrico Weigelt , Gabriel Fernandez Subject: Re: [PATCH 2/4] input: keyboard/mouse/touchscreen/misc: Use dev_get_drvdata() Message-ID: <20190702143225.12b0fe07@karo-electronics.de> In-Reply-To: References: <20190701032342.25971-1-huangfq.daxian@gmail.com> <20190701075255.GD172968@dtor-ws> Organization: Ka-Ro electronics GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, 2 Jul 2019 19:47:16 +0800 Fuqian Huang wrote: > Andy Shevchenko 於 2019年7月2日週二 下午5:51寫道: > > > > On Tue, Jul 2, 2019 at 11:20 AM Fuqian Huang 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. Lothar Waßmann