diff options
| author | Alexandre Courbot <[email protected]> | 2013-10-04 17:59:57 +0000 |
|---|---|---|
| committer | Linus Walleij <[email protected]> | 2013-10-11 14:31:53 +0000 |
| commit | 8c0fca8153224822121c85a64d6401903b9e4690 (patch) | |
| tree | 188e0eb7c0e09ebe5eda090df9570c5a7348816f /lib/spinlock_debug.c | |
| parent | gpio/lynxpoint: check if the interrupt is enabled in IRQ handler (diff) | |
| download | kernel-8c0fca8153224822121c85a64d6401903b9e4690.tar.gz kernel-8c0fca8153224822121c85a64d6401903b9e4690.zip | |
gpiolib: safer implementation of desc_to_gpio()
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 <[email protected]>
Reported-by: Dr. H. Nikolaus Schaller <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Diffstat (limited to 'lib/spinlock_debug.c')
0 files changed, 0 insertions, 0 deletions
