linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-mips@linux-mips.org, alsa-devel@alsa-project.org,
	linux-usb@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>,
	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
Subject: Re: [PATCH 00/33] devm improvement series, part 1, take 2
Date: Thu, 23 May 2013 22:32:43 +0200	[thread overview]
Message-ID: <20130523203243.GA18069@avionic-0098.adnet.avionic-design.de> (raw)
In-Reply-To: <1368702961-4325-1-git-send-email-wsa@the-dreams.de>


[-- Attachment #1.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 #1.2: Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

      parent reply	other threads:[~2013-05-23 20:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 11:15 [PATCH 00/33] devm improvement series, part 1, take 2 Wolfram Sang
     [not found] ` <1368702961-4325-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2013-05-16 11:15   ` [PATCH 17/33] drivers/spi: 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 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
2013-05-16 18:29 ` Stephen Warren
2013-05-23 20:32 ` Thierry Reding [this message]

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=20130523203243.GA18069@avionic-0098.adnet.avionic-design.de \
    --to=thierry.reding@avionic-design.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 \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=kgene.kim@samsung.com \
    --cc=lgirdwood@gmail.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-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=wsa@the-dreams.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).