diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-06-18 22:23:38 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-06-18 22:23:38 +0000 |
commit | 79d96c93610c108e734b9069115cc9e15ed8d929 (patch) | |
tree | baab34a603b601e0a94edb92390db6893e4daeb1 /target | |
parent | 40f43fbb47f5af09a999bd13716b17899037fe68 (diff) | |
download | upstream-79d96c93610c108e734b9069115cc9e15ed8d929.tar.gz upstream-79d96c93610c108e734b9069115cc9e15ed8d929.tar.bz2 upstream-79d96c93610c108e734b9069115cc9e15ed8d929.zip |
linux-3.8: backport a leds-gpio.c crash fix (fixes #13721)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36968 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/generic/patches-3.8/040-backport_led_gpio_request_fix.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/target/linux/generic/patches-3.8/040-backport_led_gpio_request_fix.patch b/target/linux/generic/patches-3.8/040-backport_led_gpio_request_fix.patch new file mode 100644 index 0000000000..b00d813840 --- /dev/null +++ b/target/linux/generic/patches-3.8/040-backport_led_gpio_request_fix.patch @@ -0,0 +1,25 @@ +--- a/drivers/leds/leds-gpio.c ++++ b/drivers/leds/leds-gpio.c +@@ -107,6 +107,10 @@ static int create_gpio_led(const struct + return 0; + } + ++ ret = devm_gpio_request(parent, template->gpio, template->name); ++ if (ret < 0) ++ return ret; ++ + led_dat->cdev.name = template->name; + led_dat->cdev.default_trigger = template->default_trigger; + led_dat->gpio = template->gpio; +@@ -126,10 +130,7 @@ static int create_gpio_led(const struct + if (!template->retain_state_suspended) + led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME; + +- ret = devm_gpio_request_one(parent, template->gpio, +- (led_dat->active_low ^ state) ? +- GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, +- template->name); ++ ret = gpio_direction_output(led_dat->gpio, led_dat->active_low ^ state); + if (ret < 0) + return ret; + |