Skip to content

Commit 0b35a45

Browse files
Holger Brunckolofj
authored andcommitted
ARM: plat-orion: make gpiochip label unique
The former implementation adds a fix gpiochip label string to the framework. This is confusing because orion_gpio_init is called more than once and this ends up in different gpiochips with the same label. This patch adds the already present orion_gpio_chip_count to the label string to make it unique in the system. Signed-off-by: Holger Brunck <[email protected]> Cc: Lennert Buytenhek <[email protected]> Acked-by: Nicolas Pitre <[email protected]> Signed-off-by: Olof Johansson <[email protected]>
1 parent 334fef0 commit 0b35a45

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm/plat-orion/gpio.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,16 @@ void __init orion_gpio_init(int gpio_base, int ngpio,
384384
struct orion_gpio_chip *ochip;
385385
struct irq_chip_generic *gc;
386386
struct irq_chip_type *ct;
387+
char gc_label[16];
387388

388389
if (orion_gpio_chip_count == ARRAY_SIZE(orion_gpio_chips))
389390
return;
390391

392+
snprintf(gc_label, sizeof(gc_label), "orion_gpio%d",
393+
orion_gpio_chip_count);
394+
391395
ochip = orion_gpio_chips + orion_gpio_chip_count;
392-
ochip->chip.label = "orion_gpio";
396+
ochip->chip.label = kstrdup(gc_label, GFP_KERNEL);
393397
ochip->chip.request = orion_gpio_request;
394398
ochip->chip.direction_input = orion_gpio_direction_input;
395399
ochip->chip.get = orion_gpio_get;

0 commit comments

Comments
 (0)