gpio: gpiolib-of: Initialise gpio only when status of node enabled
Laxman Dewangan [Fri, 25 Jul 2014 14:48:31 +0000 (19:48 +0530)]
During gpio registration, gpio library initailise the gpio provided
through device node.

Add support to check whether status is enabled or not before initialising
it.

Bug 200024061

Change-Id: Ibe272280971a8cf1a78efbd386099d383485f98d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/gpio/gpiolib-of.c

index 7afd530..1615a9a 100644 (file)
@@ -244,6 +244,9 @@ void of_gpiochip_init(struct gpio_chip *chip)
                        break;
                }
 
+               if (!of_device_is_available(np_config))
+                       continue;
+
                statename = NULL;
                /* Determine whether gpio-init-names property names the state */
                of_property_read_string_index(np, "gpio-init-names",