aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-4.1/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2016-01-18 10:46:50 +0000
committerJonas Gorski <jogo@openwrt.org>2016-01-18 10:46:50 +0000
commit74aca7d913f48d65b1c46f4772328a8459d52b44 (patch)
tree58b1587663d8c11014890d076a77dab9cb813c33 /target/linux/brcm63xx/patches-4.1/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch
parent2b3b4c95f1b398adc20b8ab23d4e169561a8e1ac (diff)
downloadupstream-74aca7d913f48d65b1c46f4772328a8459d52b44.tar.gz
upstream-74aca7d913f48d65b1c46f4772328a8459d52b44.tar.bz2
upstream-74aca7d913f48d65b1c46f4772328a8459d52b44.zip
brcm63xx: fix platform gpio lookups for gpios < 32
Overwriting static strings is never a good idea, especially expecting identical strings to be stored in different memory locations. This caused the lookups to always return the second chip's name. Fix this by just initializing the lookup with the right values, so we don't need to modify the strings at all. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 48303
Diffstat (limited to 'target/linux/brcm63xx/patches-4.1/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch')
-rw-r--r--target/linux/brcm63xx/patches-4.1/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch10
1 files changed, 5 insertions, 5 deletions
diff --git a/target/linux/brcm63xx/patches-4.1/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch b/target/linux/brcm63xx/patches-4.1/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch
index 2faf0dea29..af6eaff075 100644
--- a/target/linux/brcm63xx/patches-4.1/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch
+++ b/target/linux/brcm63xx/patches-4.1/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch
@@ -17,13 +17,13 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+#include "boards/board_common.h"
+
- /* for registering lookups; make them large enough to hold OF names */
- static char *gpio_chip_labels[] = {
- "xxxxxxxx.gpio-controller",
-@@ -50,8 +52,9 @@ static void __init bcm63xx_gpio_init_one
+ static const char * const gpio_chip_labels[] = {
+ "bcm63xx-gpio.0",
+ "bcm63xx-gpio.1",
+@@ -48,8 +50,9 @@ static void __init bcm63xx_gpio_init_one
+ pdata.base = id * 32;
pdata.ngpio = ngpio;
- sprintf(gpio_chip_labels[id], "bcm63xx-gpio.%d", id);
- platform_device_register_resndata(NULL, "bcm63xx-gpio", id, res, 2,
- &pdata, sizeof(pdata));
+ if (!board_of_device_present("gpio0"))