gpiolib: use gpio_chips list in gpiochip_find_base
authorAlexandre Courbot <acourbot@nvidia.com>
Sat, 2 Feb 2013 16:29:28 +0000 (01:29 +0900)
committerGrant Likely <grant.likely@secretlab.ca>
Sat, 9 Feb 2013 10:07:10 +0000 (10:07 +0000)
commit83cabe33eb05b51a6239a3df344d89cafac2306c
treef18d922e7558e73c2aab5e825800ad136ed2fd57
parentcb1650d4e0da27e88c1a1bd8fe98c40ae1a5d313
gpiolib: use gpio_chips list in gpiochip_find_base

Re-implement gpiochip_find_base using the list of chips instead of the
global gpio_desc[] array. This makes it both simpler and more efficient,
and is needed to remove the global descriptors array.

The new code should preserve the exact same GPIO number assignment
policy as the code it is replacing. There shouldn't be any visible
change to the assigned GPIO numbers.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
[grant.likely: Added comment about assignment policy]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/gpio/gpiolib.c