[Top] [All Lists]

Re: [PATCH 00/33] devm improvement series, part 1, take 2

To: Wolfram Sang <>
Subject: Re: [PATCH 00/33] devm improvement series, part 1, take 2
From: Thierry Reding <>
Date: Thu, 23 May 2013 22:32:43 +0200
Cc:,, Alan Stern <>, Alessandro Zummo <>, Alexander Shishkin <>,, Arnd Bergmann <>, Barry Song <>, Ben Dooks <>,, Dan Williams <>, David Airlie <>, David Woodhouse <>, Deepak Saxena <>,,, 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 <>,,,,,,,,,,,,, Marc Dietrich <>, Mark Brown <>, Matt Mackall <>,, Paul Zimmerman <>, "Rafael J. Wysocki" <>, Ralf Baechle <>,, Russell King <>, Samuel Ortiz <>, Seung-Woo Kim <>,, Stephen Warren <>, Takashi Iwai <>, Tejun Heo <>, Tomi Valkeinen <>, Tony Prisk <>, Vinod Koul <>, Viresh Kumar <>, Wan ZongShun <>, Wim Van Sebroeck <>, Zhang Rui <>
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <>
User-agent: Mutt/1.5.21 (2010-09-15)
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.


Attachment: pgpiv8hCccw2D.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>