378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. From e55892aac9d5508a000647ca66f0e678e02be3bb Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <jogo@openwrt.org>
  3. Date: Sat, 21 Feb 2015 17:26:50 +0100
  4. Subject: [PATCH 5/6] MIPS: BCM63XX: do not register gpio-controller if
  5. present in dtb
  6. Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  7. ---
  8. arch/mips/bcm63xx/gpio.c | 7 +++++--
  9. 1 file changed, 5 insertions(+), 2 deletions(-)
  10. --- a/arch/mips/bcm63xx/gpio.c
  11. +++ b/arch/mips/bcm63xx/gpio.c
  12. @@ -20,6 +20,8 @@
  13. #include <bcm63xx_gpio.h>
  14. #include <bcm63xx_regs.h>
  15. +#include "boards/board_common.h"
  16. +
  17. /* for registering lookups; make them large enough to hold OF names */
  18. static char *gpio_chip_labels[] = {
  19. "xxxxxxxx.gpio-controller",
  20. @@ -50,8 +52,9 @@ static void __init bcm63xx_gpio_init_one
  21. pdata.ngpio = ngpio;
  22. sprintf(gpio_chip_labels[id], "bcm63xx-gpio.%d", id);
  23. - platform_device_register_resndata(NULL, "bcm63xx-gpio", id, res, 2,
  24. - &pdata, sizeof(pdata));
  25. + if (!board_of_device_present("gpio0"))
  26. + platform_device_register_resndata(NULL, "bcm63xx-gpio", id, res,
  27. + 2, &pdata, sizeof(pdata));
  28. }
  29. int __init bcm63xx_gpio_init(void)