All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org, alsa-devel@alsa-project.org,
	linux-usb@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Matt Mackall <mpm@selenic.com>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Jaroslav Kysela <perex@perex.cz>,
	linux-ide@vger.kernel.org, netdev@vger.kernel.org,
	linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org,
	Evgeniy Polyakov <zbr@ioremap.net>,
	Wan ZongShun <mcuos.com@gmail.com>,
	ac100@lists.launchpad.net, devel@driverdev.osuosl.org,
	Kukjin Kim <kgene.kim@samsung.com>,
	Russell King <linux@arm.linux.org.uk>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Stephen Warren <swarren@wwwdotorg.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	cpufreq@vger.ke
Subject: [PATCH 00/33] devm improvement series, part 1, take 2
Date: Thu, 16 May 2013 13:15:28 +0200	[thread overview]
Message-ID: <1368702961-4325-1-git-send-email-wsa@the-dreams.de> (raw)

Lately, I have been experimenting how to improve the devm interface to make
writing device drivers easier and less error prone while also getting rid of
its subtle issues. I think it has more potential but still needs work and
definately conistency, especiall in its usage.

The first thing I come up with is a low hanging fruit regarding
devm_ioremap_resouce(). This function already checks if the passed resource is
valid and gives an error message if not. So, we can remove similar checks from
the drivers and get rid of a bit of code and a number of inconsistent error
strings.

Unlike the RFC version, this series only removes the unneeded check iff
devm_ioremap_resource() follows platform_get_resource directly. The previous
version tried to shuffle code if needed, too, what lead to an embarrasing bug.
It turned out to me that shuffling code for all cases found will make the
automated script too complex, so I am unsure if an automated cleanup is the
proper tool for this case. Removing the easy stuff seems worthwhile to me,
though, so I post this series in a simplified form.

Despite various architectures and platform dependencies, I managed to compile
test 45 out of 57 modified files locally using heuristics and defconfigs.
If somebody knows how to create a minimal .config with a certain kconfig symbol
(and its dependencies) set, I'd love to hear about it.

Since this series looks quite different from the RFC (less files touched
mainly) I did not copy over the ACKs from the RFC, although a few people agreed
with the aproach basically (except the major flaw the old series had).

The repo is here [1]. I'd think it would be nice to have in 3.10. and sending a
pull request to Linus would be easiest, probably. Some non-buggy RFC patches
already slipped into subtrees, yet this won't cause any conflicts.

Looking forward to comments.

Thanks,

   Wolfram

[1] git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git devm_no_resource_check


Wolfram Sang (33):
  drivers/ata: don't check resource with devm_ioremap_resource
  drivers/char/hw_random: don't check resource with
    devm_ioremap_resource
  drivers/cpufreq: don't check resource with devm_ioremap_resource
  drivers/dma: don't check resource with devm_ioremap_resource
  drivers/gpio: don't check resource with devm_ioremap_resource
  drivers/gpu/drm/exynos: don't check resource with
    devm_ioremap_resource
  drivers/gpu/host1x/drm: don't check resource with
    devm_ioremap_resource
  drivers/i2c/busses: don't check resource with devm_ioremap_resource
  drivers/memory: don't check resource with devm_ioremap_resource
  drivers/mfd: don't check resource with devm_ioremap_resource
  drivers/misc: don't check resource with devm_ioremap_resource
  drivers/mtd/nand: don't check resource with devm_ioremap_resource
  drivers/net/ethernet/renesas: don't check resource with
    devm_ioremap_resource
  drivers/pinctrl: don't check resource with devm_ioremap_resource
  drivers/pwm: don't check resource with devm_ioremap_resource
  drivers/rtc: don't check resource with devm_ioremap_resource
  drivers/spi: don't check resource with devm_ioremap_resource
  drivers/staging/dwc2: don't check resource with devm_ioremap_resource
  drivers/staging/nvec: don't check resource with devm_ioremap_resource
  drivers/thermal: don't check resource with devm_ioremap_resource
  drivers/usb/chipidea: don't check resource with devm_ioremap_resource
  drivers/usb/gadget: don't check resource with devm_ioremap_resource
  drivers/usb/host: don't check resource with devm_ioremap_resource
  drivers/usb/phy: don't check resource with devm_ioremap_resource
  drivers/video/omap2: don't check resource with devm_ioremap_resource
  drivers/video/omap2/dss: don't check resource with
    devm_ioremap_resource
  drivers/w1/masters: don't check resource with devm_ioremap_resource
  drivers/watchdog: don't check resource with devm_ioremap_resource
  arch/arm/mach-tegra: don't check resource with devm_ioremap_resource
  arch/arm/plat-samsung: don't check resource with
    devm_ioremap_resource
  arch/mips/lantiq/xway: don't check resource with
    devm_ioremap_resource
  sound/soc/fsl: don't check resource with devm_ioremap_resource
  sound/soc/kirkwood: don't check resource with devm_ioremap_resource

 arch/arm/mach-tegra/tegra2_emc.c      |    5 -----
 arch/arm/plat-samsung/adc.c           |    5 -----
 arch/mips/lantiq/xway/gptu.c          |    4 ----
 drivers/ata/pata_ep93xx.c             |    5 -----
 drivers/char/hw_random/mxc-rnga.c     |    6 ------
 drivers/char/hw_random/omap-rng.c     |    5 -----
 drivers/cpufreq/kirkwood-cpufreq.c    |    4 ----
 drivers/dma/tegra20-apb-dma.c         |    5 -----
 drivers/gpio/gpio-mvebu.c             |    5 -----
 drivers/gpio/gpio-tegra.c             |    5 -----
 drivers/gpu/drm/exynos/exynos_hdmi.c  |    5 -----
 drivers/gpu/host1x/drm/dc.c           |    5 -----
 drivers/i2c/busses/i2c-s3c2410.c      |    5 -----
 drivers/i2c/busses/i2c-sirf.c         |    6 ------
 drivers/i2c/busses/i2c-tegra.c        |    5 -----
 drivers/memory/emif.c                 |    6 ------
 drivers/mfd/intel_msic.c              |    5 -----
 drivers/misc/atmel-ssc.c              |    5 -----
 drivers/mtd/nand/lpc32xx_mlc.c        |    5 -----
 drivers/net/ethernet/renesas/sh_eth.c |    5 -----
 drivers/pinctrl/pinctrl-coh901.c      |    5 -----
 drivers/pinctrl/pinctrl-exynos5440.c  |    5 -----
 drivers/pinctrl/pinctrl-samsung.c     |    5 -----
 drivers/pinctrl/pinctrl-xway.c        |    4 ----
 drivers/pwm/pwm-imx.c                 |    5 -----
 drivers/pwm/pwm-puv3.c                |    5 -----
 drivers/pwm/pwm-pxa.c                 |    5 -----
 drivers/pwm/pwm-tegra.c               |    5 -----
 drivers/pwm/pwm-tiecap.c              |    5 -----
 drivers/pwm/pwm-tiehrpwm.c            |    5 -----
 drivers/pwm/pwm-tipwmss.c             |    5 -----
 drivers/pwm/pwm-vt8500.c              |    5 -----
 drivers/rtc/rtc-nuc900.c              |    5 -----
 drivers/rtc/rtc-omap.c                |    5 -----
 drivers/rtc/rtc-s3c.c                 |    5 -----
 drivers/rtc/rtc-tegra.c               |    6 ------
 drivers/spi/spi-tegra20-sflash.c      |    5 -----
 drivers/staging/dwc2/platform.c       |    5 -----
 drivers/staging/nvec/nvec.c           |    5 -----
 drivers/thermal/armada_thermal.c      |   10 ----------
 drivers/thermal/dove_thermal.c        |    4 ----
 drivers/thermal/exynos_thermal.c      |    5 -----
 drivers/usb/chipidea/core.c           |    5 -----
 drivers/usb/gadget/bcm63xx_udc.c      |   10 ----------
 drivers/usb/host/ohci-nxp.c           |    6 ------
 drivers/usb/phy/phy-mv-u3d-usb.c      |    5 -----
 drivers/usb/phy/phy-mxs-usb.c         |    5 -----
 drivers/usb/phy/phy-samsung-usb2.c    |    5 -----
 drivers/usb/phy/phy-samsung-usb3.c    |    5 -----
 drivers/video/omap2/dss/hdmi.c        |    4 ----
 drivers/video/omap2/vrfb.c            |    5 -----
 drivers/w1/masters/omap_hdq.c         |    5 -----
 drivers/watchdog/ath79_wdt.c          |    5 -----
 drivers/watchdog/davinci_wdt.c        |    5 -----
 drivers/watchdog/imx2_wdt.c           |    5 -----
 sound/soc/fsl/imx-ssi.c               |    6 ------
 sound/soc/kirkwood/kirkwood-i2s.c     |    5 -----
 57 files changed, 296 deletions(-)

-- 
1.7.10.4

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@the-dreams.de>
To: linux-kernel@vger.kernel.org
Cc: Wolfram Sang <wsa@the-dreams.de>,
	ac100@lists.launchpad.net, Alan Stern <stern@rowland.harvard.edu>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	alsa-devel@alsa-project.org, Arnd Bergmann <arnd@arndb.de>,
	Barry Song <baohua.song@csr.com>, Ben Dooks <ben-linux@fluff.org>,
	cpufreq@vger.kernel.org, Dan Williams <djbw@fb.com>,
	David Airlie <airlied@linux.ie>,
	David Woodhouse <dwmw2@infradead.org>,
	Deepak Saxena <dsaxena@plexity.net>,
	devel@driverdev.osuosl.org, dri-devel@lists.freedesktop.org,
	Eduardo Valentin <eduardo.valentin@ti.com>,
	Evgeniy Polyakov <zbr@ioremap.net>, Felipe Balbi <balbi@ti.com>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Grant Likely <grant.likely@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Inki Dae <inki.dae@samsung.com>, Jaroslav Kysela <perex@perex.cz>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	Julian Andres Klode <jak@jak-linux.org>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-fbdev@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-ide@vger.kernel.org, linux-mips@linux-mips.org,
	linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-tegra@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-watchdog@vger.kernel.org, Marc Dietrich <marvin24@gmx.de>,
	Mark Brown <broonie@kernel.org>, Matt Mackall <mpm@selenic.com>,
	netdev@vger.kernel.org, Paul Zimmerman <paulz@synopsys.com>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Ralf Baechle <ralf@linux-mips.org>,
	rtc-linux@googlegroups.com, Russell King <linux@arm.linux.org.uk>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	spi-devel-general@lists.sourceforge.net,
	Stephen Warren <swarren@wwwdotorg.org>,
	Takashi Iwai <tiwai@suse.de>, Tejun Heo <tj@kernel.org>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Tony Prisk <linux@prisktech.co.nz>,
	Vinod Koul <vinod.koul@intel.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Wan ZongShun <mcuos.com@gmail.com>,
	Wim Van Sebroeck <wim@iguana.be>, Zhang Rui <rui.zhang@intel.com>
Subject: [PATCH 00/33] devm improvement series, part 1, take 2
Date: Thu, 16 May 2013 13:15:28 +0200	[thread overview]
Message-ID: <1368702961-4325-1-git-send-email-wsa@the-dreams.de> (raw)

Lately, I have been experimenting how to improve the devm interface to make
writing device drivers easier and less error prone while also getting rid of
its subtle issues. I think it has more potential but still needs work and
definately conistency, especiall in its usage.

The first thing I come up with is a low hanging fruit regarding
devm_ioremap_resouce(). This function already checks if the passed resource is
valid and gives an error message if not. So, we can remove similar checks from
the drivers and get rid of a bit of code and a number of inconsistent error
strings.

Unlike the RFC version, this series only removes the unneeded check iff
devm_ioremap_resource() follows platform_get_resource directly. The previous
version tried to shuffle code if needed, too, what lead to an embarrasing bug.
It turned out to me that shuffling code for all cases found will make the
automated script too complex, so I am unsure if an automated cleanup is the
proper tool for this case. Removing the easy stuff seems worthwhile to me,
though, so I post this series in a simplified form.

Despite various architectures and platform dependencies, I managed to compile
test 45 out of 57 modified files locally using heuristics and defconfigs.
If somebody knows how to create a minimal .config with a certain kconfig symbol
(and its dependencies) set, I'd love to hear about it.

Since this series looks quite different from the RFC (less files touched
mainly) I did not copy over the ACKs from the RFC, although a few people agreed
with the aproach basically (except the major flaw the old series had).

The repo is here [1]. I'd think it would be nice to have in 3.10. and sending a
pull request to Linus would be easiest, probably. Some non-buggy RFC patches
already slipped into subtrees, yet this won't cause any conflicts.

Looking forward to comments.

Thanks,

   Wolfram

[1] git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git devm_no_resource_check


Wolfram Sang (33):
  drivers/ata: don't check resource with devm_ioremap_resource
  drivers/char/hw_random: don't check resource with
    devm_ioremap_resource
  drivers/cpufreq: don't check resource with devm_ioremap_resource
  drivers/dma: don't check resource with devm_ioremap_resource
  drivers/gpio: don't check resource with devm_ioremap_resource
  drivers/gpu/drm/exynos: don't check resource with
    devm_ioremap_resource
  drivers/gpu/host1x/drm: don't check resource with
    devm_ioremap_resource
  drivers/i2c/busses: don't check resource with devm_ioremap_resource
  drivers/memory: don't check resource with devm_ioremap_resource
  drivers/mfd: don't check resource with devm_ioremap_resource
  drivers/misc: don't check resource with devm_ioremap_resource
  drivers/mtd/nand: don't check resource with devm_ioremap_resource
  drivers/net/ethernet/renesas: don't check resource with
    devm_ioremap_resource
  drivers/pinctrl: don't check resource with devm_ioremap_resource
  drivers/pwm: don't check resource with devm_ioremap_resource
  drivers/rtc: don't check resource with devm_ioremap_resource
  drivers/spi: don't check resource with devm_ioremap_resource
  drivers/staging/dwc2: don't check resource with devm_ioremap_resource
  drivers/staging/nvec: don't check resource with devm_ioremap_resource
  drivers/thermal: don't check resource with devm_ioremap_resource
  drivers/usb/chipidea: don't check resource with devm_ioremap_resource
  drivers/usb/gadget: don't check resource with devm_ioremap_resource
  drivers/usb/host: don't check resource with devm_ioremap_resource
  drivers/usb/phy: don't check resource with devm_ioremap_resource
  drivers/video/omap2: don't check resource with devm_ioremap_resource
  drivers/video/omap2/dss: don't check resource with
    devm_ioremap_resource
  drivers/w1/masters: don't check resource with devm_ioremap_resource
  drivers/watchdog: don't check resource with devm_ioremap_resource
  arch/arm/mach-tegra: don't check resource with devm_ioremap_resource
  arch/arm/plat-samsung: don't check resource with
    devm_ioremap_resource
  arch/mips/lantiq/xway: don't check resource with
    devm_ioremap_resource
  sound/soc/fsl: don't check resource with devm_ioremap_resource
  sound/soc/kirkwood: don't check resource with devm_ioremap_resource

 arch/arm/mach-tegra/tegra2_emc.c      |    5 -----
 arch/arm/plat-samsung/adc.c           |    5 -----
 arch/mips/lantiq/xway/gptu.c          |    4 ----
 drivers/ata/pata_ep93xx.c             |    5 -----
 drivers/char/hw_random/mxc-rnga.c     |    6 ------
 drivers/char/hw_random/omap-rng.c     |    5 -----
 drivers/cpufreq/kirkwood-cpufreq.c    |    4 ----
 drivers/dma/tegra20-apb-dma.c         |    5 -----
 drivers/gpio/gpio-mvebu.c             |    5 -----
 drivers/gpio/gpio-tegra.c             |    5 -----
 drivers/gpu/drm/exynos/exynos_hdmi.c  |    5 -----
 drivers/gpu/host1x/drm/dc.c           |    5 -----
 drivers/i2c/busses/i2c-s3c2410.c      |    5 -----
 drivers/i2c/busses/i2c-sirf.c         |    6 ------
 drivers/i2c/busses/i2c-tegra.c        |    5 -----
 drivers/memory/emif.c                 |    6 ------
 drivers/mfd/intel_msic.c              |    5 -----
 drivers/misc/atmel-ssc.c              |    5 -----
 drivers/mtd/nand/lpc32xx_mlc.c        |    5 -----
 drivers/net/ethernet/renesas/sh_eth.c |    5 -----
 drivers/pinctrl/pinctrl-coh901.c      |    5 -----
 drivers/pinctrl/pinctrl-exynos5440.c  |    5 -----
 drivers/pinctrl/pinctrl-samsung.c     |    5 -----
 drivers/pinctrl/pinctrl-xway.c        |    4 ----
 drivers/pwm/pwm-imx.c                 |    5 -----
 drivers/pwm/pwm-puv3.c                |    5 -----
 drivers/pwm/pwm-pxa.c                 |    5 -----
 drivers/pwm/pwm-tegra.c               |    5 -----
 drivers/pwm/pwm-tiecap.c              |    5 -----
 drivers/pwm/pwm-tiehrpwm.c            |    5 -----
 drivers/pwm/pwm-tipwmss.c             |    5 -----
 drivers/pwm/pwm-vt8500.c              |    5 -----
 drivers/rtc/rtc-nuc900.c              |    5 -----
 drivers/rtc/rtc-omap.c                |    5 -----
 drivers/rtc/rtc-s3c.c                 |    5 -----
 drivers/rtc/rtc-tegra.c               |    6 ------
 drivers/spi/spi-tegra20-sflash.c      |    5 -----
 drivers/staging/dwc2/platform.c       |    5 -----
 drivers/staging/nvec/nvec.c           |    5 -----
 drivers/thermal/armada_thermal.c      |   10 ----------
 drivers/thermal/dove_thermal.c        |    4 ----
 drivers/thermal/exynos_thermal.c      |    5 -----
 drivers/usb/chipidea/core.c           |    5 -----
 drivers/usb/gadget/bcm63xx_udc.c      |   10 ----------
 drivers/usb/host/ohci-nxp.c           |    6 ------
 drivers/usb/phy/phy-mv-u3d-usb.c      |    5 -----
 drivers/usb/phy/phy-mxs-usb.c         |    5 -----
 drivers/usb/phy/phy-samsung-usb2.c    |    5 -----
 drivers/usb/phy/phy-samsung-usb3.c    |    5 -----
 drivers/video/omap2/dss/hdmi.c        |    4 ----
 drivers/video/omap2/vrfb.c            |    5 -----
 drivers/w1/masters/omap_hdq.c         |    5 -----
 drivers/watchdog/ath79_wdt.c          |    5 -----
 drivers/watchdog/davinci_wdt.c        |    5 -----
 drivers/watchdog/imx2_wdt.c           |    5 -----
 sound/soc/fsl/imx-ssi.c               |    6 ------
 sound/soc/kirkwood/kirkwood-i2s.c     |    5 -----
 57 files changed, 296 deletions(-)

-- 
1.7.10.4

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@the-dreams.de>
To: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org, alsa-devel@alsa-project.org,
	linux-usb@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Matt Mackall <mpm@selenic.com>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Jaroslav Kysela <perex@perex.cz>,
	linux-ide@vger.kernel.org, Wim Van Sebroeck <wim@iguana.be>,
	netdev@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-i2c@vger.kernel.org, Evgeniy Polyakov <zbr@ioremap.net>,
	Wan ZongShun <mcuos.com@gmail.com>,
	ac100@lists.launchpad.net, devel@driverdev.osuosl.org,
	Kukjin Kim <kgene.kim@samsung.com>,
	Russell King <linux@arm.linux.org.uk>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Florian Tobias Schandinat <FlorianSchandinat@gmx.de>,
	Marc Dietrich <marvin24@gmx.de>,
	Stephen Warren <swarren@wwwdotorg.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	cpufreq@vger.kernel.org,
	Eduardo Valentin <eduardo.valentin@ti.com>,
	David Airlie <airlied@linux.ie>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Grant Likely <grant.likely@linaro.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Deepak Saxena <dsaxena@plexity.net>,
	linux-watchdog@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	linux-pm@vger.kernel.org, Julian Andres Klode <jak@jak-linux.org>,
	Inki Dae <inki.dae@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	Ben Dooks <ben-linux@fluff.org>, Barry Song <baohua.song@csr.com>,
	linux-tegra@vger.kernel.org, rtc-linux@googlegroups.com,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	spi-devel-general@lists.sourceforge.net,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Liam Girdwood <lgirdwood@gmail.com>, Felipe Balbi <balbi@ti.com>,
	Tony Prisk <linux@prisktech.co.nz>,
	Vinod Koul <vinod.koul@intel.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Mark Brown <broonie@kernel.org>, Takashi Iwai <tiwai@suse.de>,
	Dan Williams <djbw@fb.com>, Tejun Heo <tj@kernel.org>,
	Samuel Ortiz <sameo@linux.intel.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Paul Zimmerman <paulz@synopsys.com>
Subject: [PATCH 00/33] devm improvement series, part 1, take 2
Date: Thu, 16 May 2013 13:15:28 +0200	[thread overview]
Message-ID: <1368702961-4325-1-git-send-email-wsa@the-dreams.de> (raw)

Lately, I have been experimenting how to improve the devm interface to make
writing device drivers easier and less error prone while also getting rid of
its subtle issues. I think it has more potential but still needs work and
definately conistency, especiall in its usage.

The first thing I come up with is a low hanging fruit regarding
devm_ioremap_resouce(). This function already checks if the passed resource is
valid and gives an error message if not. So, we can remove similar checks from
the drivers and get rid of a bit of code and a number of inconsistent error
strings.

Unlike the RFC version, this series only removes the unneeded check iff
devm_ioremap_resource() follows platform_get_resource directly. The previous
version tried to shuffle code if needed, too, what lead to an embarrasing bug.
It turned out to me that shuffling code for all cases found will make the
automated script too complex, so I am unsure if an automated cleanup is the
proper tool for this case. Removing the easy stuff seems worthwhile to me,
though, so I post this series in a simplified form.

Despite various architectures and platform dependencies, I managed to compile
test 45 out of 57 modified files locally using heuristics and defconfigs.
If somebody knows how to create a minimal .config with a certain kconfig symbol
(and its dependencies) set, I'd love to hear about it.

Since this series looks quite different from the RFC (less files touched
mainly) I did not copy over the ACKs from the RFC, although a few people agreed
with the aproach basically (except the major flaw the old series had).

The repo is here [1]. I'd think it would be nice to have in 3.10. and sending a
pull request to Linus would be easiest, probably. Some non-buggy RFC patches
already slipped into subtrees, yet this won't cause any conflicts.

Looking forward to comments.

Thanks,

   Wolfram

[1] git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git devm_no_resource_check


Wolfram Sang (33):
  drivers/ata: don't check resource with devm_ioremap_resource
  drivers/char/hw_random: don't check resource with
    devm_ioremap_resource
  drivers/cpufreq: don't check resource with devm_ioremap_resource
  drivers/dma: don't check resource with devm_ioremap_resource
  drivers/gpio: don't check resource with devm_ioremap_resource
  drivers/gpu/drm/exynos: don't check resource with
    devm_ioremap_resource
  drivers/gpu/host1x/drm: don't check resource with
    devm_ioremap_resource
  drivers/i2c/busses: don't check resource with devm_ioremap_resource
  drivers/memory: don't check resource with devm_ioremap_resource
  drivers/mfd: don't check resource with devm_ioremap_resource
  drivers/misc: don't check resource with devm_ioremap_resource
  drivers/mtd/nand: don't check resource with devm_ioremap_resource
  drivers/net/ethernet/renesas: don't check resource with
    devm_ioremap_resource
  drivers/pinctrl: don't check resource with devm_ioremap_resource
  drivers/pwm: don't check resource with devm_ioremap_resource
  drivers/rtc: don't check resource with devm_ioremap_resource
  drivers/spi: don't check resource with devm_ioremap_resource
  drivers/staging/dwc2: don't check resource with devm_ioremap_resource
  drivers/staging/nvec: don't check resource with devm_ioremap_resource
  drivers/thermal: don't check resource with devm_ioremap_resource
  drivers/usb/chipidea: don't check resource with devm_ioremap_resource
  drivers/usb/gadget: don't check resource with devm_ioremap_resource
  drivers/usb/host: don't check resource with devm_ioremap_resource
  drivers/usb/phy: don't check resource with devm_ioremap_resource
  drivers/video/omap2: don't check resource with devm_ioremap_resource
  drivers/video/omap2/dss: don't check resource with
    devm_ioremap_resource
  drivers/w1/masters: don't check resource with devm_ioremap_resource
  drivers/watchdog: don't check resource with devm_ioremap_resource
  arch/arm/mach-tegra: don't check resource with devm_ioremap_resource
  arch/arm/plat-samsung: don't check resource with
    devm_ioremap_resource
  arch/mips/lantiq/xway: don't check resource with
    devm_ioremap_resource
  sound/soc/fsl: don't check resource with devm_ioremap_resource
  sound/soc/kirkwood: don't check resource with devm_ioremap_resource

 arch/arm/mach-tegra/tegra2_emc.c      |    5 -----
 arch/arm/plat-samsung/adc.c           |    5 -----
 arch/mips/lantiq/xway/gptu.c          |    4 ----
 drivers/ata/pata_ep93xx.c             |    5 -----
 drivers/char/hw_random/mxc-rnga.c     |    6 ------
 drivers/char/hw_random/omap-rng.c     |    5 -----
 drivers/cpufreq/kirkwood-cpufreq.c    |    4 ----
 drivers/dma/tegra20-apb-dma.c         |    5 -----
 drivers/gpio/gpio-mvebu.c             |    5 -----
 drivers/gpio/gpio-tegra.c             |    5 -----
 drivers/gpu/drm/exynos/exynos_hdmi.c  |    5 -----
 drivers/gpu/host1x/drm/dc.c           |    5 -----
 drivers/i2c/busses/i2c-s3c2410.c      |    5 -----
 drivers/i2c/busses/i2c-sirf.c         |    6 ------
 drivers/i2c/busses/i2c-tegra.c        |    5 -----
 drivers/memory/emif.c                 |    6 ------
 drivers/mfd/intel_msic.c              |    5 -----
 drivers/misc/atmel-ssc.c              |    5 -----
 drivers/mtd/nand/lpc32xx_mlc.c        |    5 -----
 drivers/net/ethernet/renesas/sh_eth.c |    5 -----
 drivers/pinctrl/pinctrl-coh901.c      |    5 -----
 drivers/pinctrl/pinctrl-exynos5440.c  |    5 -----
 drivers/pinctrl/pinctrl-samsung.c     |    5 -----
 drivers/pinctrl/pinctrl-xway.c        |    4 ----
 drivers/pwm/pwm-imx.c                 |    5 -----
 drivers/pwm/pwm-puv3.c                |    5 -----
 drivers/pwm/pwm-pxa.c                 |    5 -----
 drivers/pwm/pwm-tegra.c               |    5 -----
 drivers/pwm/pwm-tiecap.c              |    5 -----
 drivers/pwm/pwm-tiehrpwm.c            |    5 -----
 drivers/pwm/pwm-tipwmss.c             |    5 -----
 drivers/pwm/pwm-vt8500.c              |    5 -----
 drivers/rtc/rtc-nuc900.c              |    5 -----
 drivers/rtc/rtc-omap.c                |    5 -----
 drivers/rtc/rtc-s3c.c                 |    5 -----
 drivers/rtc/rtc-tegra.c               |    6 ------
 drivers/spi/spi-tegra20-sflash.c      |    5 -----
 drivers/staging/dwc2/platform.c       |    5 -----
 drivers/staging/nvec/nvec.c           |    5 -----
 drivers/thermal/armada_thermal.c      |   10 ----------
 drivers/thermal/dove_thermal.c        |    4 ----
 drivers/thermal/exynos_thermal.c      |    5 -----
 drivers/usb/chipidea/core.c           |    5 -----
 drivers/usb/gadget/bcm63xx_udc.c      |   10 ----------
 drivers/usb/host/ohci-nxp.c           |    6 ------
 drivers/usb/phy/phy-mv-u3d-usb.c      |    5 -----
 drivers/usb/phy/phy-mxs-usb.c         |    5 -----
 drivers/usb/phy/phy-samsung-usb2.c    |    5 -----
 drivers/usb/phy/phy-samsung-usb3.c    |    5 -----
 drivers/video/omap2/dss/hdmi.c        |    4 ----
 drivers/video/omap2/vrfb.c            |    5 -----
 drivers/w1/masters/omap_hdq.c         |    5 -----
 drivers/watchdog/ath79_wdt.c          |    5 -----
 drivers/watchdog/davinci_wdt.c        |    5 -----
 drivers/watchdog/imx2_wdt.c           |    5 -----
 sound/soc/fsl/imx-ssi.c               |    6 ------
 sound/soc/kirkwood/kirkwood-i2s.c     |    5 -----
 57 files changed, 296 deletions(-)

-- 
1.7.10.4

             reply	other threads:[~2013-05-16 11:15 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 11:15 Wolfram Sang [this message]
2013-05-16 11:15 ` [PATCH 00/33] devm improvement series, part 1, take 2 Wolfram Sang
2013-05-16 11:15 ` Wolfram Sang
2013-05-16 11:15 ` [PATCH 01/33] drivers/ata: don't check resource with devm_ioremap_resource Wolfram Sang
2013-05-16 11:15 ` [PATCH 02/33] drivers/char/hw_random: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 03/33] drivers/cpufreq: " Wolfram Sang
2013-05-16 11:15   ` Viresh Kumar
     [not found] ` <1368702961-4325-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-05-16 11:15   ` [PATCH 04/33] drivers/dma: " Wolfram Sang
2013-05-16 11:15     ` Wolfram Sang
2013-05-16 11:15   ` [PATCH 17/33] drivers/spi: " Wolfram Sang
2013-05-16 11:15     ` Wolfram Sang
2013-05-16 11:15 ` [PATCH 05/33] drivers/gpio: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 06/33] drivers/gpu/drm/exynos: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 07/33] drivers/gpu/host1x/drm: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 08/33] drivers/i2c/busses: " Wolfram Sang
2013-05-16 11:15   ` Wolfram Sang
     [not found]   ` <1368702961-4325-9-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-05-16 12:22     ` Barry Song
2013-05-16 12:22       ` Barry Song
2013-05-16 12:22       ` Barry Song
2013-05-20 16:40   ` Kukjin Kim
2013-05-20 16:40     ` Kukjin Kim
2013-05-16 11:15 ` [PATCH 09/33] drivers/memory: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 10/33] drivers/mfd: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 11/33] drivers/misc: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 12/33] drivers/mtd/nand: " Wolfram Sang
2013-05-16 11:15   ` Wolfram Sang
2013-05-16 11:15 ` [PATCH 13/33] drivers/net/ethernet/renesas: " Wolfram Sang
2013-05-16 15:37   ` Joe Perches
2013-05-16 11:15 ` [PATCH 14/33] drivers/pinctrl: " Wolfram Sang
2013-05-20 11:39   ` Linus Walleij
2013-05-20 17:13     ` Wolfram Sang
2013-05-20 18:34       ` Linus Walleij
2013-05-16 11:15 ` [PATCH 15/33] drivers/pwm: " Wolfram Sang
2013-05-16 11:15   ` Wolfram Sang
2013-05-16 11:15 ` [PATCH 16/33] drivers/rtc: " Wolfram Sang
2013-05-16 11:15   ` Wolfram Sang
2013-05-16 11:15   ` Wolfram Sang
2013-05-16 11:15 ` [PATCH 18/33] drivers/staging/dwc2: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 19/33] drivers/staging/nvec: " Wolfram Sang
2013-05-16 11:15   ` Wolfram Sang
2013-05-16 11:15 ` [PATCH 20/33] drivers/thermal: " Wolfram Sang
2013-05-20 15:38   ` Zhang, Rui
2013-05-16 11:15 ` [PATCH 21/33] drivers/usb/chipidea: " Wolfram Sang
2013-05-16 11:29   ` Alexander Shishkin
2013-05-16 11:15 ` [PATCH 22/33] drivers/usb/gadget: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 23/33] drivers/usb/host: " Wolfram Sang
2013-05-16 14:27   ` Alan Stern
2013-05-16 11:15 ` [PATCH 24/33] drivers/usb/phy: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 25/33] drivers/video/omap2: " Wolfram Sang
2013-05-16 11:15   ` Wolfram Sang
2013-05-16 11:15 ` [PATCH 26/33] drivers/video/omap2/dss: " Wolfram Sang
2013-05-16 11:15   ` Wolfram Sang
2013-05-16 11:15 ` [PATCH 27/33] drivers/w1/masters: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 28/33] drivers/watchdog: " Wolfram Sang
2013-05-16 11:15 ` [PATCH 29/33] arch/arm/mach-tegra: " Wolfram Sang
2013-05-16 11:15   ` Wolfram Sang
2013-05-16 11:15 ` [PATCH 30/33] arch/arm/plat-samsung: " Wolfram Sang
2013-05-16 11:15   ` Wolfram Sang
2013-05-20 16:38   ` Kukjin Kim
2013-05-20 16:38     ` Kukjin Kim
2013-05-20 17:11     ` Wolfram Sang
2013-05-20 17:11       ` Wolfram Sang
2013-05-20 17:13       ` Kukjin Kim
2013-05-20 17:13         ` Kukjin Kim
2013-05-16 11:15 ` [PATCH 31/33] arch/mips/lantiq/xway: " Wolfram Sang
2013-05-16 14:42   ` John Crispin
2013-05-16 11:16 ` [PATCH 32/33] sound/soc/fsl: " Wolfram Sang
2013-05-16 11:16 ` [PATCH 33/33] sound/soc/kirkwood: " Wolfram Sang
2013-05-16 11:57 ` [PATCH 00/33] devm improvement series, part 1, take 2 Artem Bityutskiy
2013-05-16 11:57   ` Artem Bityutskiy
2013-05-16 11:57   ` Artem Bityutskiy
2013-05-16 12:55   ` Viresh Kumar
2013-05-16 12:55     ` Viresh Kumar
2013-05-16 12:55     ` Viresh Kumar
2013-05-16 12:55     ` Viresh Kumar
2013-05-16 13:11     ` Artem Bityutskiy
2013-05-16 13:11       ` Artem Bityutskiy
2013-05-16 13:11       ` Artem Bityutskiy
2013-05-16 13:11       ` Artem Bityutskiy
2013-05-16 13:11       ` Artem Bityutskiy
2013-05-16 13:17       ` Tomi Valkeinen
2013-05-16 13:17         ` Tomi Valkeinen
2013-05-16 13:17         ` Tomi Valkeinen
2013-05-16 13:17         ` Tomi Valkeinen
2013-05-16 13:17         ` Tomi Valkeinen
2013-05-16 16:13       ` Wolfram Sang
2013-05-16 16:13         ` Wolfram Sang
2013-05-16 16:13         ` Wolfram Sang
2013-05-16 16:13         ` Wolfram Sang
2013-05-16 18:29 ` Stephen Warren
2013-05-16 18:29   ` Stephen Warren
2013-05-16 18:29   ` Stephen Warren
2013-05-16 18:29   ` Stephen Warren
2013-05-23 20:32 ` Thierry Reding
2013-05-23 20:32   ` Thierry Reding
2013-05-23 20:32   ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368702961-4325-1-git-send-email-wsa@the-dreams.de \
    --to=wsa@the-dreams.de \
    --cc=FlorianSchandinat@gmx.de \
    --cc=ac100@lists.launchpad.net \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=cpufreq@vger.ke \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=kgene.kim@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mcuos.com@gmail.com \
    --cc=mpm@selenic.com \
    --cc=netdev@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rjw@sisk.pl \
    --cc=swarren@wwwdotorg.org \
    --cc=viresh.kumar@linaro.org \
    --cc=zbr@ioremap.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.