lkml.org 
[lkml]   [2013]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/2] gpiolib: safer implementation of desc_to_gpio()
From
On Fri, Oct 4, 2013 at 7:59 PM, Alexandre Courbot <acourbot@nvidia.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@nvidia.com>
> Reported-by: Dr. H. Nikolaus Schaller <hns@goldelico.com>

Patch applied.

Yours,
Linus Walleij


\
 
 \ /
  Last update: 2013-10-11 16:41    [W:0.046 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site