Re: [PATCH 5/5] gpio: move gpio_ensure_requested() into legacy C file

Varka Bhadram
2014-07-22T08:31:55Z

On 07/22/2014 12:47 PM, Alexandre Courbot wrote:

(...)

> + if (WARN(test_and_set_bit(FLAG_REQUESTED, &desc->flags) == 0,
> + "autorequest GPIO-%d\n", desc_to_gpio(desc))) {
> + if (!try_module_get(chip->owner)) {
> + gpiod_err(desc, "%s: module can't be gotten\n",
> + __func__);

Should match open parenthesis '('

gpiod_err(desc, "%s: module can't be gotten\n",
__func__);

> + clear_bit(FLAG_REQUESTED, &desc->flags);
> + /* lose */
> + err = -EIO;
> + goto end;
> + }
> + desc->label = "[auto]";
> + /* caller must chip->request() w/o spinlock */
> + if (chip->request)
> + request = true;
> + }
> +
> +end:
> + spin_unlock_irqrestore(&gpio_lock, flags);
> +
> + if (request) {
> + might_sleep_if(chip->can_sleep);
> + err = chip->request(chip, gpio_chip_hwgpio(desc));
> +
> + if (err < 0) {
> + gpiod_dbg(desc, "%s: chip request fail, %d\n",
> + __func__, err);

Dto..

(...)

--
Regards,
Varka Bhadram.