Skip to content
Commit 8d0aab2f authored by Anton Vorontsov's avatar Anton Vorontsov Committed by Linus Torvalds
Browse files

gpiolib: dynamic gpio number allocation



If gpio_chip->base is negative during registration, gpiolib performs dynamic
base allocation.  This is useful for devices that aren't always present, such
as GPIOs on hotplugged devices rather than mainboards.  (This behavior was
previously specified but not implemented.)

To avoid using any numbers that may have been explicitly assigned but not yet
registered, this dynamic allocation assigns GPIO numbers from the biggest
number on down, instead of from the smallest on up.

Signed-off-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e6de1808
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment