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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 8B5C4C67863 for ; Mon, 22 Oct 2018 04:11:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3678E20852 for ; Mon, 22 Oct 2018 04:11:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3678E20852 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=davemloft.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727407AbeJVM16 (ORCPT ); Mon, 22 Oct 2018 08:27:58 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:52054 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbeJVM16 (ORCPT ); Mon, 22 Oct 2018 08:27:58 -0400 Received: from localhost (c-67-183-62-245.hsd1.wa.comcast.net [67.183.62.245]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id DBE09100A3F73; Sun, 21 Oct 2018 21:11:11 -0700 (PDT) Date: Sun, 21 Oct 2018 21:11:08 -0700 (PDT) Message-Id: <20181021.211108.848222946495599164.davem@davemloft.net> To: wsa+renesas@sang-engineering.com Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 0/9] net: simplify getting .driver_data From: David Miller In-Reply-To: <20181021200021.1693-1-wsa+renesas@sang-engineering.com> References: <20181021200021.1693-1-wsa+renesas@sang-engineering.com> X-Mailer: Mew version 6.7 on Emacs 26 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 21 Oct 2018 21:11:12 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wolfram Sang Date: Sun, 21 Oct 2018 22:00:11 +0200 > I got tired of fixing this in Renesas drivers manually, so I took the big > hammer. Remove this cumbersome code pattern which got copy-pasted too much > already: > > - struct platform_device *pdev = to_platform_device(dev); > - struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); > + struct ep93xx_keypad *keypad = dev_get_drvdata(dev); > > A branch, tested by buildbot, can be found here: > > git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git coccinelle/get_drvdata > > I have been asked if it couldn't be done for dev_set_drvdata as well. I checked > it and did not find one occasion where it could be simplified like this. Not > much of a surprise because driver_data is usually set in probe() functions > which access struct platform_device in many other ways. > > I am open for other comments, suggestions, too, of course. > > Here is the cocci-script I created: ... Series applied to net-next, thanks.