summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2013-10-04 10:59:57 -0700
committerArve Hjønnevåg <arve@android.com>2013-12-17 02:01:29 +0000
commita1eabac6e216f8ecee7668ad4468990e465392ba (patch)
treed83dce39a43f9938c372a3dcc5740129bd001434 /android
parente513299f8dc0a79e6e3f5ee79615426edaf086b9 (diff)
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 <acourbot@nvidia.com> Reported-by: Dr. H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'android')
0 files changed, 0 insertions, 0 deletions