aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorZhangfei Gao <zhangfei.gao@linaro.org>2013-06-08 23:08:32 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-06-20 04:37:41 -0400
commit3bae4811fb6d0b2849e3129abaf9c116f956c7a3 (patch)
tree6e155487d1c1265183074cadb3219b86cee4e621 /drivers/gpio
parent61e3884ec1b41ebd0395e7faf856592f228c8724 (diff)
gpiolib: remove warnning of allocations with IRQs disabled
Move of_gpiochip_add outof spin_lock, since kzalloc inside of_gpiochip_add -> of_gpiochip_add_pin_range -> gpiochip_add_pin_range -> kzalloc WARNING: at kernel/lockdep.c:2740 lockdep_trace_alloc+0xf8/0xfc() DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags)) Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index c2534d62911c..ff0fd655729f 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1214,15 +1214,14 @@ int gpiochip_add(struct gpio_chip *chip)
1214 } 1214 }
1215 } 1215 }
1216 1216
1217 spin_unlock_irqrestore(&gpio_lock, flags);
1218
1217#ifdef CONFIG_PINCTRL 1219#ifdef CONFIG_PINCTRL
1218 INIT_LIST_HEAD(&chip->pin_ranges); 1220 INIT_LIST_HEAD(&chip->pin_ranges);
1219#endif 1221#endif
1220 1222
1221 of_gpiochip_add(chip); 1223 of_gpiochip_add(chip);
1222 1224
1223unlock:
1224 spin_unlock_irqrestore(&gpio_lock, flags);
1225
1226 if (status) 1225 if (status)
1227 goto fail; 1226 goto fail;
1228 1227
@@ -1235,6 +1234,9 @@ unlock:
1235 chip->label ? : "generic"); 1234 chip->label ? : "generic");
1236 1235
1237 return 0; 1236 return 0;
1237
1238unlock:
1239 spin_unlock_irqrestore(&gpio_lock, flags);
1238fail: 1240fail:
1239 /* failures here can mean systems won't boot... */ 1241 /* failures here can mean systems won't boot... */
1240 pr_err("gpiochip_add: gpios %d..%d (%s) failed to register\n", 1242 pr_err("gpiochip_add: gpios %d..%d (%s) failed to register\n",