From mboxrd@z Thu Jan 1 00:00:00 1970 From: holger.brunck@keymile.com (Holger Brunck) Date: Thu, 15 Dec 2011 15:40:08 +0100 Subject: label string for kirkwood gpiochip In-Reply-To: References: <4EE9FC0D.10009@keymile.com> Message-ID: <4EEA06C8.5010302@keymile.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 12/15/2011 03:22 PM, Nicolas Pitre wrote: >> >> The newer kernel version handles the gpiochip on kirkwood in a different way. >> The orion_gpio_init function in arch/arm/mach-kirkwood/irq.c was called twice. >> Once for first 32 gpios and a second time for the remaining 18 gpios. This >> causes that the gpio framework shows two gpiochips in the sysfs with the same >> label (orion_gpio). >> >> [@km_kirkwood /]# cat /sys/class/gpio/gpiochip0/label >> orion_gpio >> [@km_kirkwood /]# cat /sys/class/gpio/gpiochip32/label >> orion_gpio >> >> So my question is simply, shouldn't be the string for a gpiochip unique in the >> system and therefore this should be fixed or was this intended? > > I don't think that was intended. > Ok, how should this be done? We could add an additional param chip_label to void __init orion_gpio_init(int gpio_base, int ngpio, u32 base, int mask_offset, int secondary_irq_base); and fix the callers accordingly or we could add a simple static counter in orion_gpio_init and add a suffix _0, _1, _2 to the label to make it unique without touching the clients... Best regards Holger