[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdb=rEiXJqnkS8mQeo1gO3r7r8GYCNmopsjh9iDC4HagvQ@mail.gmail.com>
Date: Fri, 11 Oct 2013 16:25:14 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Alexandre Courbot <acourbot@...dia.com>
Cc: "Dr. H. Nikolaus Schaller" <hns@...delico.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Alexandre Courbot <gnurou@...il.com>
Subject: Re: [PATCH 1/2] gpiolib: safer implementation of desc_to_gpio()
On Fri, Oct 4, 2013 at 7:59 PM, Alexandre Courbot <acourbot@...dia.com> wrote:
> The current implementation of desc_to_gpio() relies on the chip pointer
> to be set to a valid value in order to compute the GPIO number. This
> was done in the hope that we can get rid of the gpio_desc global array,
> but this is not happening anytime soon.
>
> This patch reimplements desc_to_gpio() in a fashion similar to that of
> gpio_to_desc(). As a result, desc_to_gpio(gpio_to_desc(gpio)) == gpio is
> now always true. This allows to call desc_to_gpio() on non-initialized
> descriptors as some error-handling code currently does.
>
> Signed-off-by: Alexandre Courbot <acourbot@...dia.com>
> Reported-by: Dr. H. Nikolaus Schaller <hns@...delico.com>
Patch applied.
Yours,
Linus Walleij
--
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