Received: by 10.192.165.156 with SMTP id m28csp779339imm; Thu, 19 Apr 2018 07:26:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/6uJsSQ72vZPjMXf6DUo1JBOMI5tf+d3RQNIE3tsUL6uYY+Zimb7wP9S7iaU9UBEA/ksVN X-Received: by 10.167.128.207 with SMTP id a15mr6009203pfn.116.1524148015498; Thu, 19 Apr 2018 07:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148015; cv=none; d=google.com; s=arc-20160816; b=j1ELH1K1Yz6gainD/rvRjWQRULuIwMMaGxppUbms2SixjBjats6qcb/JaIWfNSGwfL NsJm30bN7B/4hE4TCznEiOvhdcXpHiEWOY21XN5k5XjRF4bdzplozeTyY0qjTwfcHQUS a3yX1BxTeuADY2bTxOmSsTDSXBNk+8ru+vH5tGIQRRgTLX54QG416t9OTEXdPtF9pKoR +Sv45hOyYG6ilWXLa10gCa8+B1SRg9mUxdQmy9URPGsShQzCuNm/uQZuiAOnuq2v43Gv DyKSftXDWwDn13XbRIcvlPbA9PE3KwjJkoiEhZTAkAPPm+cSXc3Td8JZa5c7efIq7/CU FVdA== 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=QgaPQHeUQJMaEjcqxtvfjczGogAn3DHkZly0yBZyisc=; b=NlvsY1i/7FBsds19RPnUcQNjG00meNWXBVi5mWIzHJKem6jAO7d5k3kanMPEqCKsE4 g+gpxj4YAf8oB5ejBdVCO2UERSShBrGpBeibLpWWtxvgnXSj0p6HMoP2pVvIDlfM1osg P89Nr7scttbH0YdzaKIqaOpY5AU+oRrNnyZVGt+++yqBZt4VT6p3yRjCz+JRtf6B1Cgx 2JKSsEpWk93NfnA1SWWWAb2uV5FnnHFf46llaossXxSfKLGk9j1naoh+Osw8Q4DI1wBN hM3dzSoVLpOH086VfTc+eVlqZG+QZDtNB/gJPylL+NWK09lFq+BcDxItZaumWtKMD/RZ 4Cqw== 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 k2si3088758pgr.200.2018.04.19.07.26.41; Thu, 19 Apr 2018 07:26:55 -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 S1753782AbeDSOY5 (ORCPT + 99 others); Thu, 19 Apr 2018 10:24:57 -0400 Received: from sauhun.de ([88.99.104.3]:45198 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752647AbeDSOGy (ORCPT ); Thu, 19 Apr 2018 10:06:54 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 3BE743139AC; Thu, 19 Apr 2018 16:06:47 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wolfram Sang , ac100@lists.launchpad.net, acpi4asus-user@lists.sourceforge.net, alsa-devel@alsa-project.org, devel@driverdev.osuosl.org, dmaengine@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, greybus-dev@lists.linaro.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-crypto@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-gpio@vger.kernel.org, linux-ide@vger.kernel.org, linux-iio@vger.kernel.org, linux-input@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-media@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pwm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-rtc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-soc@vger.kernel.org, linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, netdev@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH 00/61] tree-wide: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:05:30 +0200 Message-Id: <20180419140641.27926-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 (after iterations by manually checking samples): @@ 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 (61): ARM: plat-samsung: simplify getting .drvdata ata: simplify getting .drvdata auxdisplay: simplify getting .drvdata bus: simplify getting .drvdata clk: samsung: simplify getting .drvdata crypto: simplify getting .drvdata dma: simplify getting .drvdata dmaengine: dw: simplify getting .drvdata dmaengine: qcom: simplify getting .drvdata gpio: simplify getting .drvdata gpu: drm: msm: simplify getting .drvdata gpu: drm: msm: adreno: simplify getting .drvdata gpu: drm: msm: disp: mdp5: simplify getting .drvdata gpu: drm: msm: dsi: simplify getting .drvdata gpu: drm: omapdrm: displays: simplify getting .drvdata gpu: drm: vc4: simplify getting .drvdata hid: simplify getting .drvdata iio: common: cros_ec_sensors: simplify getting .drvdata iio: common: hid-sensors: simplify getting .drvdata input: keyboard: simplify getting .drvdata input: misc: simplify getting .drvdata input: mouse: simplify getting .drvdata input: touchscreen: simplify getting .drvdata iommu: simplify getting .drvdata media: platform: am437x: simplify getting .drvdata media: platform: exynos4-is: simplify getting .drvdata media: platform: s5p-mfc: simplify getting .drvdata mmc: host: simplify getting .drvdata mtd: devices: simplify getting .drvdata mtd: nand: onenand: simplify getting .drvdata net: dsa: simplify getting .drvdata net: ethernet: cadence: simplify getting .drvdata net: ethernet: davicom: simplify getting .drvdata net: ethernet: smsc: simplify getting .drvdata net: ethernet: ti: simplify getting .drvdata net: ethernet: wiznet: simplify getting .drvdata perf: simplify getting .drvdata pinctrl: simplify getting .drvdata pinctrl: intel: simplify getting .drvdata platform: x86: simplify getting .drvdata power: supply: simplify getting .drvdata ptp: simplify getting .drvdata pwm: simplify getting .drvdata rtc: simplify getting .drvdata slimbus: simplify getting .drvdata spi: simplify getting .drvdata staging: greybus: simplify getting .drvdata staging: iio: adc: simplify getting .drvdata staging: nvec: simplify getting .drvdata thermal: simplify getting .drvdata thermal: int340x_thermal: simplify getting .drvdata thermal: st: simplify getting .drvdata tty: serial: simplify getting .drvdata uio: simplify getting .drvdata usb: mtu3: simplify getting .drvdata usb: phy: simplify getting .drvdata video: fbdev: simplify getting .drvdata video: fbdev: omap2: omapfb: displays: simplify getting .drvdata watchdog: simplify getting .drvdata net: dsa: simplify getting .drvdata ASoC: atmel: simplify getting .drvdata arch/arm/plat-samsung/adc.c | 3 +- drivers/ata/pata_samsung_cf.c | 8 ++--- drivers/auxdisplay/arm-charlcd.c | 6 ++-- drivers/bus/brcmstb_gisb.c | 12 +++---- drivers/clk/samsung/clk-s3c2410-dclk.c | 6 ++-- drivers/crypto/exynos-rng.c | 6 ++-- drivers/crypto/picoxcell_crypto.c | 6 ++-- drivers/dma/at_hdmac.c | 9 ++--- drivers/dma/at_xdmac.c | 9 ++--- drivers/dma/dw/platform.c | 6 ++-- drivers/dma/fsldma.c | 6 ++-- drivers/dma/idma64.c | 6 ++-- drivers/dma/qcom/hidma.c | 3 +- drivers/dma/qcom/hidma_mgmt_sys.c | 6 ++-- drivers/dma/ste_dma40.c | 12 +++---- drivers/dma/txx9dmac.c | 8 ++--- drivers/gpio/gpio-dwapb.c | 6 ++-- drivers/gpio/gpio-lynxpoint.c | 3 +- drivers/gpio/gpio-omap.c | 12 +++---- drivers/gpio/gpio-tegra.c | 6 ++-- drivers/gpio/gpio-zynq.c | 6 ++-- drivers/gpu/drm/msm/adreno/adreno_device.c | 6 ++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 6 ++-- drivers/gpu/drm/msm/dsi/dsi_host.c | 6 ++-- drivers/gpu/drm/msm/msm_drv.c | 3 +- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 18 ++++------ drivers/gpu/drm/vc4/vc4_drv.c | 3 +- drivers/hid/hid-sensor-custom.c | 12 +++---- .../common/cros_ec_sensors/cros_ec_sensors_core.c | 6 ++-- .../iio/common/hid-sensors/hid-sensor-trigger.c | 9 ++--- drivers/input/keyboard/ep93xx_keypad.c | 10 +++--- drivers/input/keyboard/imx_keypad.c | 10 +++--- drivers/input/keyboard/lpc32xx-keys.c | 6 ++-- drivers/input/keyboard/matrix_keypad.c | 10 +++--- drivers/input/keyboard/omap4-keypad.c | 10 +++--- drivers/input/keyboard/pmic8xxx-keypad.c | 6 ++-- drivers/input/keyboard/pxa27x_keypad.c | 10 +++--- drivers/input/keyboard/samsung-keypad.c | 12 +++---- drivers/input/keyboard/snvs_pwrkey.c | 10 +++--- drivers/input/keyboard/spear-keyboard.c | 10 +++--- drivers/input/keyboard/st-keyscan.c | 6 ++-- drivers/input/keyboard/tegra-kbc.c | 10 +++--- drivers/input/misc/max77693-haptic.c | 6 ++-- drivers/input/misc/max8997_haptic.c | 3 +- drivers/input/misc/palmas-pwrbutton.c | 6 ++-- drivers/input/misc/regulator-haptic.c | 6 ++-- drivers/input/misc/twl4030-vibra.c | 3 +- drivers/input/misc/twl6040-vibra.c | 3 +- drivers/input/mouse/navpoint.c | 6 ++-- drivers/input/touchscreen/imx6ul_tsc.c | 6 ++-- drivers/iommu/qcom_iommu.c | 6 ++-- drivers/media/platform/am437x/am437x-vpfe.c | 6 ++-- drivers/media/platform/exynos4-is/media-dev.c | 6 ++-- drivers/media/platform/exynos4-is/mipi-csis.c | 6 ++-- drivers/media/platform/s5p-mfc/s5p_mfc.c | 6 ++-- drivers/mmc/host/davinci_mmc.c | 6 ++-- drivers/mmc/host/sdhci-of-arasan.c | 6 ++-- drivers/mmc/host/wmt-sdmmc.c | 6 ++-- drivers/mtd/devices/docg3.c | 3 +- drivers/mtd/nand/onenand/samsung.c | 6 ++-- drivers/net/dsa/bcm_sf2.c | 6 ++-- drivers/net/dsa/qca8k.c | 6 ++-- drivers/net/ethernet/cadence/macb_main.c | 6 ++-- drivers/net/ethernet/davicom/dm9000.c | 6 ++-- drivers/net/ethernet/smsc/smc91x.c | 3 +- drivers/net/ethernet/ti/cpsw.c | 6 ++-- drivers/net/ethernet/ti/davinci_emac.c | 6 ++-- drivers/net/ethernet/wiznet/w5300.c | 6 ++-- drivers/perf/arm_spe_pmu.c | 6 ++-- drivers/pinctrl/intel/pinctrl-baytrail.c | 6 ++-- drivers/pinctrl/intel/pinctrl-cherryview.c | 6 ++-- drivers/pinctrl/intel/pinctrl-intel.c | 6 ++-- drivers/pinctrl/pinctrl-amd.c | 6 ++-- drivers/pinctrl/pinctrl-at91-pio4.c | 6 ++-- drivers/platform/x86/asus-laptop.c | 3 +- drivers/platform/x86/asus-wmi.c | 3 +- drivers/platform/x86/samsung-laptop.c | 3 +- drivers/power/supply/gpio-charger.c | 3 +- drivers/ptp/ptp_dte.c | 6 ++-- drivers/pwm/pwm-atmel-tcb.c | 6 ++-- drivers/pwm/pwm-rcar.c | 3 +- drivers/rtc/rtc-bq4802.c | 6 ++-- drivers/rtc/rtc-ds1216.c | 6 ++-- drivers/rtc/rtc-ds1511.c | 9 ++--- drivers/rtc/rtc-ds1553.c | 15 +++----- drivers/rtc/rtc-ds1685.c | 21 ++++------- drivers/rtc/rtc-ds1742.c | 6 ++-- drivers/rtc/rtc-lpc32xx.c | 16 ++++----- drivers/rtc/rtc-m48t59.c | 41 +++++++++------------- drivers/rtc/rtc-mv.c | 3 +- drivers/rtc/rtc-mxc.c | 21 ++++------- drivers/rtc/rtc-pcap.c | 15 +++----- drivers/rtc/rtc-sh.c | 15 +++----- drivers/rtc/rtc-stk17ta8.c | 15 +++----- drivers/rtc/rtc-test.c | 3 +- drivers/rtc/rtc-zynqmp.c | 10 +++--- drivers/slimbus/qcom-ctrl.c | 6 ++-- drivers/spi/spi-cadence.c | 6 ++-- drivers/spi/spi-zynqmp-gqspi.c | 6 ++-- drivers/staging/greybus/arche-platform.c | 3 +- drivers/staging/iio/adc/ad7606_par.c | 6 ++-- drivers/staging/nvec/nvec.c | 6 ++-- drivers/thermal/int340x_thermal/int3400_thermal.c | 9 ++--- drivers/thermal/rockchip_thermal.c | 8 ++--- drivers/thermal/spear_thermal.c | 8 ++--- drivers/thermal/st/st_thermal.c | 6 ++-- drivers/thermal/zx2967_thermal.c | 6 ++-- drivers/tty/serial/imx.c | 18 ++++------ drivers/tty/serial/qcom_geni_serial.c | 6 ++-- drivers/tty/serial/st-asc.c | 6 ++-- drivers/tty/serial/xilinx_uartps.c | 6 ++-- drivers/uio/uio_fsl_elbc_gpcm.c | 6 ++-- drivers/usb/mtu3/mtu3_plat.c | 6 ++-- drivers/usb/phy/phy-am335x.c | 6 ++-- drivers/video/fbdev/auo_k190x.c | 12 +++---- .../fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 18 ++++------ drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++-- drivers/video/fbdev/sh_mobile_meram.c | 6 ++-- drivers/watchdog/cadence_wdt.c | 6 ++-- drivers/watchdog/of_xilinx_wdt.c | 6 ++-- drivers/watchdog/wdat_wdt.c | 6 ++-- net/dsa/legacy.c | 6 ++-- sound/soc/atmel/atmel_ssc_dai.c | 6 ++-- 123 files changed, 319 insertions(+), 607 deletions(-) -- 2.11.0