Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: ftdi_sio: fix gpio name collisions

Drop the gpio line names, which cause gpiolib to complain loudly
whenever a second ftdi gpiochip is registered:

gpio gpiochip5: Detected name collision for GPIO name 'CBUS0'
gpio gpiochip5: Detected name collision for GPIO name 'CBUS1'
gpio gpiochip5: Detected name collision for GPIO name 'CBUS2'
gpio gpiochip5: Detected name collision for GPIO name 'CBUS3'

and also prevents the legacy sysfs interface from being used (as the
line names are used as device names whenever they are set):

sysfs: cannot create duplicate filename '/class/gpio/CBUS0'

Until non-unique names are supported by gpiolib (without warnings and
stack dumps), let's leave the gpio lines unnamed.

Signed-off-by: Johan Hovold <johan@kernel.org>

-5
-5
drivers/usb/serial/ftdi_sio.c
··· 1778 1778 1779 1779 #ifdef CONFIG_GPIOLIB 1780 1780 1781 - static const char * const ftdi_ftx_gpio_names[] = { 1782 - "CBUS0", "CBUS1", "CBUS2", "CBUS3" 1783 - }; 1784 - 1785 1781 static int ftdi_set_bitmode(struct usb_serial_port *port, u8 mode) 1786 1782 { 1787 1783 struct ftdi_private *priv = usb_get_serial_port_data(port); ··· 2028 2032 2029 2033 /* FIXME: FT234XD alone has 1 GPIO, but how to recognize this IC? */ 2030 2034 priv->gc.ngpio = 4; 2031 - priv->gc.names = ftdi_ftx_gpio_names; 2032 2035 2033 2036 /* Determine which pins are configured for CBUS bitbanging */ 2034 2037 priv->gpio_altfunc = 0xff;