Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3305596ybi; Tue, 2 Jul 2019 05:42:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRrhKKjHQWvJLisMT5zFsNIHqPlAfQ6d+j2kdHmgufDZLscLPJPw5cmsnYvEU59UG2jxKf X-Received: by 2002:a63:204b:: with SMTP id r11mr11547776pgm.121.1562071332585; Tue, 02 Jul 2019 05:42:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562071332; cv=none; d=google.com; s=arc-20160816; b=JqfDdlZw92vQw8j8k3XXPP0HlJF8JC8Gr2U2ySQl2p3Zxb6t7jhywCEhKvQDiJO3Ui n6QYz0BYMYeRm8FtA9hoHS/ulg2l7v6K4VroObpnnTpd5AKd1GpfZSMgKIV5BzUPmqU7 fFEhPOUbV5POmdy/oYmg27EYT24/ERiioPguvM4KUHJqh7vo38xHNZ+4ZgcQR8/ldTzv YTxgWy4gf6sDhDsEJZ5V208f0HSiNLHV7z4pPGlrvpcnHZdhMk1sA6Kb9qwvV5PyontM BphLps6dnu0hX26K8eTg9VXjNK09smB12KJlvLQOMLhpozRgSyOvye8VG6lvvbuUxTfG pkOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=UA/itIaKzziwwTIN7+IJl/ju00GZ+bsmT9YrsnKfNFs=; b=O+dZrfibOvELmlvwwxx1EZWXyCFWE502khSstOaB2clJAzPz05UGj3vW9qiFKrCvK4 iJu42u4f2ztBemwzGPg4W4c5Mxf/ZBc8RjnBAGFdKmVNlfflYu8fvHQxqfgSoy576Mxg +/88NyrP2w1a0nkRl8+/fzFvMwp2Wv2fLEKmeH+TNve+EVZ9B/cY2AEeVjMJcKlqBwsL nMJL1Jr5pQ1nsWaZJTvJgI5MiL2cEqapp87FhCaEcFQjt/AYFpB8JHfUxWiC1IHHdWdj OfGgkFe/DXXpfN4iDqYCBYXY+s3P3Czm9LnoUMVGbP/5XGVLK7GiKLo85Mg0JvCAn7VL EERA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r72si2261790pjb.33.2019.07.02.05.41.57; Tue, 02 Jul 2019 05:42:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727049AbfGBMjd convert rfc822-to-8bit (ORCPT + 99 others); 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) X-Spam-Level: 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