diff options
| -rw-r--r-- | drivers/gpio/gpio-omap.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 3a0c1606f885..c57244ef428b 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
| @@ -1037,6 +1037,18 @@ omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start, | |||
| 1037 | IRQ_NOREQUEST | IRQ_NOPROBE, 0); | 1037 | IRQ_NOREQUEST | IRQ_NOPROBE, 0); |
| 1038 | } | 1038 | } |
| 1039 | 1039 | ||
| 1040 | #if defined(CONFIG_OF_GPIO) | ||
| 1041 | static inline bool omap_gpio_chip_boot_dt(struct gpio_chip *chip) | ||
| 1042 | { | ||
| 1043 | return chip->of_node != NULL; | ||
| 1044 | } | ||
| 1045 | #else | ||
| 1046 | static inline bool omap_gpio_chip_boot_dt(struct gpio_chip *chip) | ||
| 1047 | { | ||
| 1048 | return false; | ||
| 1049 | } | ||
| 1050 | #endif | ||
| 1051 | |||
| 1040 | static void omap_gpio_chip_init(struct gpio_bank *bank) | 1052 | static void omap_gpio_chip_init(struct gpio_bank *bank) |
| 1041 | { | 1053 | { |
| 1042 | int j; | 1054 | int j; |
| @@ -1077,7 +1089,7 @@ static void omap_gpio_chip_init(struct gpio_bank *bank) | |||
| 1077 | * irq_create_of_mapping() only for the GPIO lines that | 1089 | * irq_create_of_mapping() only for the GPIO lines that |
| 1078 | * are used as interrupts. | 1090 | * are used as interrupts. |
| 1079 | */ | 1091 | */ |
| 1080 | if (!bank->chip.of_node) | 1092 | if (!omap_gpio_chip_boot_dt(&bank->chip)) |
| 1081 | for (j = 0; j < bank->width; j++) | 1093 | for (j = 0; j < bank->width; j++) |
| 1082 | irq_create_mapping(bank->domain, j); | 1094 | irq_create_mapping(bank->domain, j); |
| 1083 | irq_set_chained_handler(bank->irq, gpio_irq_handler); | 1095 | irq_set_chained_handler(bank->irq, gpio_irq_handler); |
| @@ -1113,7 +1125,7 @@ static int omap_gpio_irq_map(struct irq_domain *d, unsigned int virq, | |||
| 1113 | * but until then this has to be done on a per driver | 1125 | * but until then this has to be done on a per driver |
| 1114 | * basis. Remove this once this is managed by the core. | 1126 | * basis. Remove this once this is managed by the core. |
| 1115 | */ | 1127 | */ |
| 1116 | if (bank->chip.of_node) { | 1128 | if (omap_gpio_chip_boot_dt(&bank->chip)) { |
| 1117 | gpio = irq_to_gpio(bank, hwirq); | 1129 | gpio = irq_to_gpio(bank, hwirq); |
| 1118 | ret = gpio_request_one(gpio, GPIOF_IN, NULL); | 1130 | ret = gpio_request_one(gpio, GPIOF_IN, NULL); |
| 1119 | if (ret) { | 1131 | if (ret) { |
