Received: by 10.192.165.148 with SMTP id m20csp2189548imm; Sun, 22 Apr 2018 02:16:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx48F6skNVam/yCcrt7FGBp/Fdr0Zblg9Q1C36IS1kBqqdGIvlSCDsWOhyglVEBc4s1sHxL65 X-Received: by 10.98.91.71 with SMTP id p68mr15887378pfb.128.1524388592754; Sun, 22 Apr 2018 02:16:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524388592; cv=none; d=google.com; s=arc-20160816; b=RAsJLoKmben/Jhe74aYLQ8LhL3SZKteykFX5XZsJGwA4d4y7tIkrgVc12j7ypyTAh2 U1CZEbqjzp9GSlGP1MWMoLFtSXQfIRan8j+5trmbqApLZasnUM17AaloAyUoLv5Lmfeo hhfqfbAsTknJGvc1XnDLT6r0QpmbGSt15L4w/upkb7C6qxq/at3qPSaTXOf6F+cmQLAS TTCNNYOL12lmqfPKbswZnydGe/raBznL4EDPonJPdNUD8b6hx7B2DCLB0EpyMnQdQeEe Mr6uOEv24/SDa6kkLf8wg2CgtckjOz6nNdWJ4D6IfB5m0JU0pHPpCmmXq3lSQo3Wz8ea 40oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yy1D+JbMaKLhMGJOPLS2VR/rMh/W+DysyToSRn+UvJk=; b=tOuZxF/B6YWaqiQgfr/DXlY45HlzKpPtKWyMgOFF72jkXEboHprB7tvt4lDiQQE9jx Th4dvpeRpMQ/1c5lVgXkJ5X+khiBLWiDtU7GU4mrcs+kTbLMsF1YWezrRhjxmX9lmURs r971NbL4pjY0rqOMRXsVnATf2rq0547mndJpIKr0LeU8oibT1NwCoLtSS58XnXPum/BI rmg1ZYGoQEN60lV5KFFk0UkfN/brK23pnbHiHpwELd7K8kvIHSrWCuSU4g0fex1TssfN DdVZGAG6MwAnUN3Wxc5pvGlYIoiuWhaV8MmVbZsXhv8ZsxoEMzypoDbgyjv+cB/LVchI zloA== 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 e98-v6si9443899plb.273.2018.04.22.02.16.18; Sun, 22 Apr 2018 02:16:32 -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 S1752300AbeDVJOV (ORCPT + 99 others); Sun, 22 Apr 2018 05:14:21 -0400 Received: from sauhun.de ([88.99.104.3]:37538 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751564AbeDVJOT (ORCPT ); Sun, 22 Apr 2018 05:14:19 -0400 Received: from localhost (p5486C379.dip0.t-ipconnect.de [84.134.195.121]) by pokefinder.org (Postfix) with ESMTPSA id AD5BF3274F6; Sun, 22 Apr 2018 11:14:16 +0200 (CEST) From: Wolfram Sang To: dmaengine@vger.kernel.org Cc: Wolfram Sang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 0/6] tree-wide: simplify getting .drvdata Date: Sun, 22 Apr 2018 11:14:08 +0200 Message-Id: <20180422091415.7587-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); I send this out as one patch per directory per subsystem. I think they should be applied individually. If you prefer a broken out series per subsystem, I can provide this as well. Just mail me. A branch (tested by buildbot; only with all commits squashed into one commit before) can be found here: git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git coccinelle/get_drvdata Open for other comments, suggestions, too, of course. Here is the cocci-script I created: @@ struct device* d; identifier pdev; expression *ptr; @@ ( - struct platform_device *pdev = to_platform_device(d); | - struct platform_device *pdev; ... - pdev = to_platform_device(d); ) <... when != pdev - &pdev->dev + d ...> ptr = - platform_get_drvdata(pdev) + dev_get_drvdata(d) <... when != pdev - &pdev->dev + d ...> Kind regards, Wolfram Wolfram Sang (6): dmaengine: at_hdmac: simplify getting .drvdata dmaengine: at_xdmac: simplify getting .drvdata dmaengine: fsldma: simplify getting .drvdata dmaengine: idma64: simplify getting .drvdata dmaengine: ste_dma40: simplify getting .drvdata dmaengine: txx9dmac: simplify getting .drvdata drivers/dma/at_hdmac.c | 9 +++------ drivers/dma/at_xdmac.c | 9 +++------ drivers/dma/fsldma.c | 6 ++---- drivers/dma/idma64.c | 6 ++---- drivers/dma/ste_dma40.c | 12 ++++-------- drivers/dma/txx9dmac.c | 8 +++----- 6 files changed, 17 insertions(+), 33 deletions(-) -- 2.11.0