[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53BD3A1D.8060401@codethink.co.uk>
Date: Wed, 09 Jul 2014 13:48:29 +0100
From: Rob Jones <rob.jones@...ethink.co.uk>
To: Julia Lawall <julia.lawall@...6.fr>
CC: Himangi Saraogi <himangi774@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Randy Dunlap <rdunlap@...radead.org>,
linux-doc@...r.kernel.org, Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
patches@...nsource.wolfsonmicro.com, alsa-devel@...a-project.org,
Eric Miao <eric.y.miao@...il.com>,
Russell King <linux@....linux.org.uk>,
Haojian Zhuang <haojian.zhuang@...il.com>,
linux-arm-kernel@...ts.infradead.org,
Philipp Zabel <philipp.zabel@...il.com>,
Paul Parsons <lost.distance@...oo.com>
Subject: Re: [PATCH 1/5] gpiolib: devres: Introduce the function devm_request_gpio_array
On 09/07/14 12:52, Julia Lawall wrote:
>
>
> On Wed, 9 Jul 2014, Rob Jones wrote:
>
>> Please note that I submitted a patch on 02/07/14 to create this
>> function which was acked by Linus Walleij on 05/07/14.
>>
>> Great minds think alike, and all that.
>>
>> However, I think that the version I submitted better replicates the
>> original (non devm) functionality, see below.
<snip>
>>> +int devm_gpio_request_array(struct device *dev, const struct gpio *array,
>>> + size_t num)
>>> +{
>>> + int i, err;
>>> +
>>> + for (i = 0; i < num; i++, array++) {
>>> + err = devm_gpio_request_one(dev, array->gpio, array->flags,
>>> + array->label);
>>> + if (err)
>>> + return err;
>>
>> The failure path in the version I submitted frees up any already
>> allocated gpios on the first failure.
>
> Himangi first proposed doing that, but I thought it was not really in the
> spirit of devm functions, which is to leave that implicit. No strong
> opinion on the matter, though.
>
Interestingly, we came at it from the other direction: I originally
didn't have the unwind in and our internal review guys suggested that
it was in the original function so putting it in would:
1. make this a better analogue of the original
2. help avoid deadlocks
3. allow the driver to retry, perhaps requesting reduced functionality.
> julia
>
<snip>
--
Rob Jones
Codethink Ltd
mailto:rob.jones@...ethink.co.uk
tel:+44 161 236 5575
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists