Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH 00/33] devm improvement series, part 1, take 2
@ 2013-05-16 11:15 Wolfram Sang
  2013-05-16 11:15 ` [PATCH 31/33] arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource Wolfram Sang
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Wolfram Sang @ 2013-05-16 11:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Wolfram Sang, ac100, Alan Stern, Alessandro Zummo,
	Alexander Shishkin, alsa-devel, Arnd Bergmann, Barry Song,
	Ben Dooks, cpufreq, Dan Williams, David Airlie, David Woodhouse,
	Deepak Saxena, devel, dri-devel, Eduardo Valentin,
	Evgeniy Polyakov, Felipe Balbi, Florian Tobias Schandinat,
	Grant Likely, Greg Kroah-Hartman, Herbert Xu, Inki Dae,
	Jaroslav Kysela, Joonyoung Shim, Julian Andres Klode, Kukjin Kim,
	Kyungmin Park, Liam Girdwood, Linus Torvalds, Linus Walleij,
	linux-arm-kernel, linux-fbdev, linux-i2c, linux-ide, linux-mips,
	linux-mtd, linux-omap, linux-pm, linux-samsung-soc, linux-tegra,
	linux-usb, linux-watchdog, Marc Dietrich, Mark Brown,
	Matt Mackall, netdev, Paul Zimmerman, Rafael J. Wysocki,
	Ralf Baechle, rtc-linux, Russell King, Samuel Ortiz,
	Seung-Woo Kim, spi-devel-general, Stephen Warren, Takashi Iwai,
	Tejun Heo, Thierry Reding, Tomi Valkeinen, Tony Prisk, Vinod Koul,
	Viresh Kumar, Wan ZongShun, Wim Van Sebroeck, Zhang Rui

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 31/33] arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource
  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 14:42   ` John Crispin
  2013-05-16 11:57 ` [PATCH 00/33] devm improvement series, part 1, take 2 Artem Bityutskiy
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Wolfram Sang @ 2013-05-16 11:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: Wolfram Sang, Ralf Baechle, linux-mips

devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 arch/mips/lantiq/xway/gptu.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c
index 9861c86..d6a79b8 100644
--- a/arch/mips/lantiq/xway/gptu.c
+++ b/arch/mips/lantiq/xway/gptu.c
@@ -144,10 +144,6 @@ static int gptu_probe(struct platform_device *pdev)
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "Failed to get resource\n");
-		return -ENOMEM;
-	}
 
 	/* remap gptu register range */
 	gptu_membase = devm_ioremap_resource(&pdev->dev, res);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 00/33] devm improvement series, part 1, take 2
  2013-05-16 11:15 [PATCH 00/33] devm improvement series, part 1, take 2 Wolfram Sang
  2013-05-16 11:15 ` [PATCH 31/33] arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource Wolfram Sang
@ 2013-05-16 11:57 ` Artem Bityutskiy
  2013-05-16 12:55   ` Viresh Kumar
  2013-05-16 18:29 ` Stephen Warren
  2013-05-23 20:32 ` Thierry Reding
  3 siblings, 1 reply; 11+ messages in thread
From: Artem Bityutskiy @ 2013-05-16 11:57 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel, linux-mips, alsa-devel, linux-usb,
	Alexander Shishkin, Viresh Kumar, Linus Walleij, Matt Mackall,
	linux-fbdev, dri-devel, Jaroslav Kysela, linux-ide,
	Wim Van Sebroeck, netdev, linux-mtd, linux-i2c, Evgeniy Polyakov,
	Wan ZongShun, ac100, devel, Kukjin Kim, Russell King, Herbert Xu,
	Florian Tobias Schandinat, Marc Dietrich, Stephen Warren,
	Rafael J. Wysocki, cpufreq, Eduardo Valentin, David Airlie,
	Tomi Valkeinen, Alan Stern, Grant Likely, Zhang Rui,
	Thierry Reding, Deepak Saxena, linux-watchdog, Arnd Bergmann,
	linux-pm, Julian Andres Klode, Inki Dae, linux-samsung-soc,
	Ben Dooks, Barry Song, linux-tegra, rtc-linux, linux-omap,
	linux-arm-kernel, Joonyoung Shim, Alessandro Zummo,
	spi-devel-general, Greg Kroah-Hartman, Ralf Baechle,
	Linus Torvalds, Seung-Woo Kim, Liam Girdwood, Felipe Balbi,
	Tony Prisk, Vinod Koul, Kyungmin Park, Mark Brown, Takashi Iwai,
	Dan Williams, Tejun Heo, Samuel Ortiz, David Woodhouse,
	Paul Zimmerman

On Thu, 2013-05-16 at 13:15 +0200, Wolfram Sang wrote:
> 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.

If you find this out, please, share!

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 00/33] devm improvement series, part 1, take 2
  2013-05-16 11:57 ` [PATCH 00/33] devm improvement series, part 1, take 2 Artem Bityutskiy
@ 2013-05-16 12:55   ` Viresh Kumar
  2013-05-16 13:11     ` Artem Bityutskiy
  0 siblings, 1 reply; 11+ messages in thread
From: Viresh Kumar @ 2013-05-16 12:55 UTC (permalink / raw)
  To: dedekind1
  Cc: Wolfram Sang, linux-kernel, linux-mips, alsa-devel, linux-usb,
	Alexander Shishkin, Linus Walleij, Matt Mackall, linux-fbdev,
	dri-devel, Jaroslav Kysela, linux-ide, Wim Van Sebroeck, netdev,
	linux-mtd, linux-i2c, Evgeniy Polyakov, Wan ZongShun, ac100,
	devel, Kukjin Kim, Russell King, Herbert Xu,
	Florian Tobias Schandinat, Marc Dietrich, Stephen Warren,
	Rafael J. Wysocki, cpufreq, Eduardo Valentin, David Airlie,
	Tomi Valkeinen, Alan Stern, Grant Likely, Zhang Rui,
	Thierry Reding, Deepak Saxena, linux-watchdog, Arnd Bergmann,
	linux-pm, Julian Andres Klode, Inki Dae, linux-samsung-soc,
	Ben Dooks, Barry Song, linux-tegra, rtc-linux, linux-omap,
	linux-arm-kernel, Joonyoung Shim, Alessandro Zummo,
	spi-devel-general, Greg Kroah-Hartman, Ralf Baechle,
	Linus Torvalds, Seung-Woo Kim, Liam Girdwood, Felipe Balbi,
	Tony Prisk, Vinod Koul, Kyungmin Park, Mark Brown, Takashi Iwai,
	Dan Williams, Tejun Heo, Samuel Ortiz, David Woodhouse,
	Paul Zimmerman

On 16 May 2013 17:27, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Thu, 2013-05-16 at 13:15 +0200, Wolfram Sang wrote:
>> 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.
>
> If you find this out, please, share!

Are you guys looking for "make savedefconfig" ??

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 00/33] devm improvement series, part 1, take 2
  2013-05-16 12:55   ` Viresh Kumar
@ 2013-05-16 13:11     ` Artem Bityutskiy
  2013-05-16 13:17       ` Tomi Valkeinen
  2013-05-16 16:13       ` Wolfram Sang
  0 siblings, 2 replies; 11+ messages in thread
From: Artem Bityutskiy @ 2013-05-16 13:11 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Wolfram Sang, linux-kernel, linux-mips, alsa-devel, linux-usb,
	Alexander Shishkin, Linus Walleij, Matt Mackall, linux-fbdev,
	dri-devel, Jaroslav Kysela, linux-ide, Wim Van Sebroeck, netdev,
	linux-mtd, linux-i2c, Evgeniy Polyakov, Wan ZongShun, ac100,
	devel, Kukjin Kim, Russell King, Herbert Xu,
	Florian Tobias Schandinat, Marc Dietrich, Stephen Warren,
	Rafael J. Wysocki, cpufreq, Eduardo Valentin, David Airlie,
	Tomi Valkeinen, Alan Stern, Grant Likely, Zhang Rui,
	Thierry Reding, Deepak Saxena, linux-watchdog, Arnd Bergmann,
	linux-pm, Julian Andres Klode, Inki Dae, linux-samsung-soc,
	Ben Dooks, Barry Song, linux-tegra, rtc-linux, linux-omap,
	linux-arm-kernel, Joonyoung Shim, Alessandro Zummo,
	spi-devel-general, Greg Kroah-Hartman, Ralf Baechle,
	Linus Torvalds, Seung-Woo Kim, Liam Girdwood, Felipe Balbi,
	Tony Prisk, Vinod Koul, Kyungmin Park, Mark Brown, Takashi Iwai,
	Dan Williams, Tejun Heo, Samuel Ortiz, David Woodhouse,
	Paul Zimmerman

On Thu, 2013-05-16 at 18:25 +0530, Viresh Kumar wrote:
> On 16 May 2013 17:27, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > On Thu, 2013-05-16 at 13:15 +0200, Wolfram Sang wrote:
> >> 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.
> >
> > If you find this out, please, share!
> 
> Are you guys looking for "make savedefconfig" ??

No. It is more like:

I have changed this strange driver.

I want to compile-test my changes.

I need a defconfig which would have this driver enabled. I also want to
know <arch> for my "make ARCH=<arch>" command.

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 00/33] devm improvement series, part 1, take 2
  2013-05-16 13:11     ` Artem Bityutskiy
@ 2013-05-16 13:17       ` Tomi Valkeinen
  2013-05-16 13:17         ` Tomi Valkeinen
  2013-05-16 16:13       ` Wolfram Sang
  1 sibling, 1 reply; 11+ messages in thread
From: Tomi Valkeinen @ 2013-05-16 13:17 UTC (permalink / raw)
  To: dedekind1
  Cc: Viresh Kumar, Wolfram Sang, linux-kernel, linux-mips, alsa-devel,
	linux-usb, Alexander Shishkin, Linus Walleij, Matt Mackall,
	linux-fbdev, dri-devel, Jaroslav Kysela, linux-ide,
	Wim Van Sebroeck, netdev, linux-mtd, linux-i2c, Evgeniy Polyakov,
	Wan ZongShun, ac100, devel, Kukjin Kim, Russell King, Herbert Xu,
	Florian Tobias Schandinat, Marc Dietrich, Stephen Warren,
	Rafael J. Wysocki, cpufreq, Eduardo Valentin, David Airlie,
	Alan Stern, Grant Likely, Zhang Rui, Thierry Reding,
	Deepak Saxena, linux-watchdog, Arnd Bergmann, linux-pm,
	Julian Andres Klode, Inki Dae, linux-samsung-soc, Ben Dooks,
	Barry Song, linux-tegra, rtc-linux, linux-omap, linux-arm-kernel,
	Joonyoung Shim, Alessandro Zummo, spi-devel-general,
	Greg Kroah-Hartman, Ralf Baechle, Linus Torvalds, Seung-Woo Kim,
	Liam Girdwood, Felipe Balbi, Tony Prisk, Vinod Koul,
	Kyungmin Park, Mark Brown, Takashi Iwai, Dan Williams, Tejun Heo,
	Samuel Ortiz, David Woodhouse, Paul Zimmerman

[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]

On 16/05/13 16:11, Artem Bityutskiy wrote:
> On Thu, 2013-05-16 at 18:25 +0530, Viresh Kumar wrote:
>> On 16 May 2013 17:27, Artem Bityutskiy <dedekind1@gmail.com> wrote:
>>> On Thu, 2013-05-16 at 13:15 +0200, Wolfram Sang wrote:
>>>> 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.
>>>
>>> If you find this out, please, share!
>>
>> Are you guys looking for "make savedefconfig" ??
> 
> No. It is more like:
> 
> I have changed this strange driver.
> 
> I want to compile-test my changes.
> 
> I need a defconfig which would have this driver enabled. I also want to
> know <arch> for my "make ARCH=<arch>" command.

Not quite the same thing, but I sent this a while ago:

http://lkml.indiana.edu/hypermail/linux/kernel/1304.3/02847.html

My "softdepends" feature is probably not needed, as pointed out in the
thread, as the behavior can be implemented with the current Kconfig
language just fine.

I had a quick look at fbdev drivers, and some of them compile fine on
all (well, arm and x86) archs. But many do have real arch dependencies.

I think it'd be a good long term goal to make drivers arch-independent,
and add CONFIG_SHOW_ALL_DRIVERS or such, which would allow compiling
drivers that are not used on your arch, but still compile fine.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 00/33] devm improvement series, part 1, take 2
  2013-05-16 13:17       ` Tomi Valkeinen
@ 2013-05-16 13:17         ` Tomi Valkeinen
  0 siblings, 0 replies; 11+ messages in thread
From: Tomi Valkeinen @ 2013-05-16 13:17 UTC (permalink / raw)
  To: dedekind1
  Cc: Viresh Kumar, Wolfram Sang, linux-kernel, linux-mips, alsa-devel,
	linux-usb, Alexander Shishkin, Linus Walleij, Matt Mackall,
	linux-fbdev, dri-devel, Jaroslav Kysela, linux-ide,
	Wim Van Sebroeck, netdev, linux-mtd, linux-i2c, Evgeniy Polyakov,
	Wan ZongShun, ac100, devel, Kukjin Kim, Russell King, Herbert Xu,
	Florian Tobias Schandinat, Marc Dietrich, Stephen Warren,
	Rafael J. Wysocki, cpufreq, Eduardo Valentin, David Airlie,
	Alan Stern, Grant Likely, Zhang Rui, Thierry Reding,
	Deepak Saxena, linux-watchdog, Arnd Bergmann, linux-pm,
	Julian Andres Klode, Inki Dae, linux-samsung-soc, Ben Dooks,
	Barry Song, linux-tegra, rtc-linux, linux-omap, linux-arm-kernel,
	Joonyoung Shim, Alessandro Zummo, spi-devel-general,
	Greg Kroah-Hartman, Ralf Baechle, Linus Torvalds, Seung-Woo Kim,
	Liam Girdwood, Felipe Balbi, Tony Prisk, Vinod Koul,
	Kyungmin Park, Mark Brown, Takashi Iwai, Dan Williams, Tejun Heo,
	Samuel Ortiz, David Woodhouse, Paul Zimmerman

[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]

On 16/05/13 16:11, Artem Bityutskiy wrote:
> On Thu, 2013-05-16 at 18:25 +0530, Viresh Kumar wrote:
>> On 16 May 2013 17:27, Artem Bityutskiy <dedekind1@gmail.com> wrote:
>>> On Thu, 2013-05-16 at 13:15 +0200, Wolfram Sang wrote:
>>>> 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.
>>>
>>> If you find this out, please, share!
>>
>> Are you guys looking for "make savedefconfig" ??
> 
> No. It is more like:
> 
> I have changed this strange driver.
> 
> I want to compile-test my changes.
> 
> I need a defconfig which would have this driver enabled. I also want to
> know <arch> for my "make ARCH=<arch>" command.

Not quite the same thing, but I sent this a while ago:

http://lkml.indiana.edu/hypermail/linux/kernel/1304.3/02847.html

My "softdepends" feature is probably not needed, as pointed out in the
thread, as the behavior can be implemented with the current Kconfig
language just fine.

I had a quick look at fbdev drivers, and some of them compile fine on
all (well, arm and x86) archs. But many do have real arch dependencies.

I think it'd be a good long term goal to make drivers arch-independent,
and add CONFIG_SHOW_ALL_DRIVERS or such, which would allow compiling
drivers that are not used on your arch, but still compile fine.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 31/33] arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource
  2013-05-16 11:15 ` [PATCH 31/33] arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource Wolfram Sang
@ 2013-05-16 14:42   ` John Crispin
  0 siblings, 0 replies; 11+ messages in thread
From: John Crispin @ 2013-05-16 14:42 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-kernel, Ralf Baechle, linux-mips

On 16/05/13 13:15, Wolfram Sang wrote:
> devm_ioremap_resource does sanity checks on the given resource. No need to
> duplicate this in the driver.
>
> Signed-off-by: Wolfram Sang<wsa@the-dreams.de>

Acked-by: John Crispin <blogic@openwrt.org>





> ---
>   arch/mips/lantiq/xway/gptu.c |    4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c
> index 9861c86..d6a79b8 100644
> --- a/arch/mips/lantiq/xway/gptu.c
> +++ b/arch/mips/lantiq/xway/gptu.c
> @@ -144,10 +144,6 @@ static int gptu_probe(struct platform_device *pdev)
>   	}
>
>   	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(&pdev->dev, "Failed to get resource\n");
> -		return -ENOMEM;
> -	}
>
>   	/* remap gptu register range */
>   	gptu_membase = devm_ioremap_resource(&pdev->dev, res);

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 00/33] devm improvement series, part 1, take 2
  2013-05-16 13:11     ` Artem Bityutskiy
  2013-05-16 13:17       ` Tomi Valkeinen
@ 2013-05-16 16:13       ` Wolfram Sang
  1 sibling, 0 replies; 11+ messages in thread
From: Wolfram Sang @ 2013-05-16 16:13 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: Viresh Kumar, linux-kernel, linux-mips, alsa-devel, linux-usb,
	Alexander Shishkin, Linus Walleij, Matt Mackall, linux-fbdev,
	dri-devel, Jaroslav Kysela, linux-ide, Wim Van Sebroeck, netdev,
	linux-mtd, linux-i2c, Evgeniy Polyakov, Wan ZongShun, ac100,
	devel, Kukjin Kim, Russell King, Herbert Xu,
	Florian Tobias Schandinat, Marc Dietrich, Stephen Warren,
	Rafael J. Wysocki, cpufreq, Eduardo Valentin, David Airlie,
	Tomi Valkeinen, Alan Stern, Grant Likely, Zhang Rui,
	Thierry Reding, Deepak Saxena, linux-watchdog, Arnd Bergmann,
	linux-pm, Julian Andres Klode, Inki Dae, linux-samsung-soc,
	Ben Dooks, Barry Song, linux-tegra, rtc-linux, linux-omap,
	linux-arm-kernel, Joonyoung Shim, Alessandro Zummo,
	spi-devel-general, Greg Kroah-Hartman, Ralf Baechle,
	Linus Torvalds, Seung-Woo Kim, Liam Girdwood, Felipe Balbi,
	Tony Prisk, Vinod Koul, Kyungmin Park, Mark Brown, Takashi Iwai,
	Dan Williams, Tejun Heo, Samuel Ortiz, David Woodhouse,
	Paul Zimmerman


> I need a defconfig which would have this driver enabled. 

My wish would be a minimal config. Right now, I try to build the driver
with the current config and when that fails I grep through the
(uncompressed) defconfigs for the symbol needed. Gives me 45/57 success
rate on this series. Not perfect, but the best I could come up with
without writing a .config-generator myself.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 00/33] devm improvement series, part 1, take 2
  2013-05-16 11:15 [PATCH 00/33] devm improvement series, part 1, take 2 Wolfram Sang
  2013-05-16 11:15 ` [PATCH 31/33] arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource Wolfram Sang
  2013-05-16 11:57 ` [PATCH 00/33] devm improvement series, part 1, take 2 Artem Bityutskiy
@ 2013-05-16 18:29 ` Stephen Warren
  2013-05-23 20:32 ` Thierry Reding
  3 siblings, 0 replies; 11+ messages in thread
From: Stephen Warren @ 2013-05-16 18:29 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel, ac100, Alan Stern, Alessandro Zummo,
	Alexander Shishkin, alsa-devel, Arnd Bergmann, Barry Song,
	Ben Dooks, cpufreq, Dan Williams, David Airlie, David Woodhouse,
	Deepak Saxena, devel, dri-devel, Eduardo Valentin,
	Evgeniy Polyakov, Felipe Balbi, Florian Tobias Schandinat,
	Grant Likely, Greg Kroah-Hartman, Herbert Xu, Inki Dae,
	Jaroslav Kysela, Joonyoung Shim, Julian Andres Klode, Kukjin Kim,
	Kyungmin Park, Liam Girdwood, Linus Torvalds, Linus Walleij,
	linux-arm-kernel, linux-fbdev, linux-i2c, linux-ide, linux-mips,
	linux-mtd, linux-omap, linux-pm, linux-samsung-soc, linux-tegra,
	linux-usb, linux-watchdog, Marc Dietrich, Mark Brown,
	Matt Mackall, netdev, Paul Zimmerman, Rafael J. Wysocki,
	Ralf Baechle, rtc-linux, Russell King, Samuel Ortiz,
	Seung-Woo Kim, spi-devel-general, Takashi Iwai, Tejun Heo,
	Thierry Reding, Tomi Valkeinen, Tony Prisk, Vinod Koul,
	Viresh Kumar, Wan ZongShun, Wim Van Sebroeck, Zhang Rui

On 05/16/2013 05:15 AM, Wolfram Sang wrote:
> 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 Tegra parts in patches 4, 5, 8, 15, 16, 17, 29 all,
Acked-by: Stephen Warren <swarren@nvidia.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 00/33] devm improvement series, part 1, take 2
  2013-05-16 11:15 [PATCH 00/33] devm improvement series, part 1, take 2 Wolfram Sang
                   ` (2 preceding siblings ...)
  2013-05-16 18:29 ` Stephen Warren
@ 2013-05-23 20:32 ` Thierry Reding
  3 siblings, 0 replies; 11+ messages in thread
From: Thierry Reding @ 2013-05-23 20:32 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel, ac100, Alan Stern, Alessandro Zummo,
	Alexander Shishkin, alsa-devel, Arnd Bergmann, Barry Song,
	Ben Dooks, cpufreq, Dan Williams, David Airlie, David Woodhouse,
	Deepak Saxena, devel, dri-devel, Eduardo Valentin,
	Evgeniy Polyakov, Felipe Balbi, Florian Tobias Schandinat,
	Grant Likely, Greg Kroah-Hartman, Herbert Xu, Inki Dae,
	Jaroslav Kysela, Joonyoung Shim, Julian Andres Klode, Kukjin Kim,
	Kyungmin Park, Liam Girdwood, Linus Torvalds, Linus Walleij,
	linux-arm-kernel, linux-fbdev, linux-i2c, linux-ide, linux-mips,
	linux-mtd, linux-omap, linux-pm, linux-samsung-soc, linux-tegra,
	linux-usb, linux-watchdog, Marc Dietrich, Mark Brown,
	Matt Mackall, netdev, Paul Zimmerman, Rafael J. Wysocki,
	Ralf Baechle, rtc-linux, Russell King, Samuel Ortiz,
	Seung-Woo Kim, spi-devel-general, Stephen Warren, Takashi Iwai,
	Tejun Heo, Tomi Valkeinen, Tony Prisk, Vinod Koul, Viresh Kumar,
	Wan ZongShun, Wim Van Sebroeck, Zhang Rui

[-- Attachment #1: Type: text/plain, Size: 1291 bytes --]

On Thu, May 16, 2013 at 01:15:28PM +0200, Wolfram Sang wrote:
> 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.

Sorry for jumping in so late. I generally like the idea. One small
inconvenience is that devm_ioremap_resource() returns -EINVAL if
res == NULL, which means that drivers will now also return -EINVAL
in cases where no resource was returned. Typically drivers handle
this by returning something like -ENODEV, -ENXIO, -ENOENT. Some do
return -EINVAL but perhaps having a separate error code (and maybe
error message as well) for a missing resource would be helpful.

Doing this would be rather easy now that you've paved the way by
making devm_ioremap_resource() usage consistent across drivers.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-05-23 20:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-16 11:15 [PATCH 00/33] devm improvement series, part 1, take 2 Wolfram Sang
2013-05-16 11:15 ` [PATCH 31/33] arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource Wolfram Sang
2013-05-16 14:42   ` John Crispin
2013-05-16 11:57 ` [PATCH 00/33] devm improvement series, part 1, take 2 Artem Bityutskiy
2013-05-16 12:55   ` Viresh Kumar
2013-05-16 13:11     ` Artem Bityutskiy
2013-05-16 13:17       ` Tomi Valkeinen
2013-05-16 13:17         ` Tomi Valkeinen
2013-05-16 16:13       ` Wolfram Sang
2013-05-16 18:29 ` Stephen Warren
2013-05-23 20:32 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox