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.
+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.
julia