lkml.org 
[lkml]   [2018]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] USB: serial: ftdi_sio: implement GPIO support for FT230X
Hi Karoly,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on usb-serial/usb-next]
[also build test ERROR on v4.19-rc1 next-20180827]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Karoly-Pados/USB-serial-ftdi_sio-implement-GPIO-support-for-FT230X/20180827-005902
base: https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git usb-next
config: mips-rm200_defconfig (attached as .config)
compiler: mipsel-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=mips

All errors (new ones prefixed by >>):

drivers/usb/serial/ftdi_sio.c: In function 'ftdi_sio_port_probe':
>> drivers/usb/serial/ftdi_sio.c:2090:30: error: passing argument 1 of 'ftdi_sio_gpio_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
result = ftdi_sio_gpio_init(port);
^~~~
drivers/usb/serial/ftdi_sio.c:2030:12: note: expected 'struct usb_serial *' but argument is of type 'struct usb_serial_port *'
static int ftdi_sio_gpio_init(struct usb_serial *serial)
^~~~~~~~~~~~~~~~~~
drivers/usb/serial/ftdi_sio.c: In function 'ftdi_sio_port_remove':
>> drivers/usb/serial/ftdi_sio.c:2213:23: error: passing argument 1 of 'ftdi_sio_gpio_remove' from incompatible pointer type [-Werror=incompatible-pointer-types]
ftdi_sio_gpio_remove(port);
^~~~
drivers/usb/serial/ftdi_sio.c:2035:13: note: expected 'struct usb_serial *' but argument is of type 'struct usb_serial_port *'
static void ftdi_sio_gpio_remove(struct usb_serial *serial)
^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +/ftdi_sio_gpio_init +2090 drivers/usb/serial/ftdi_sio.c

2065
2066 static int ftdi_sio_port_probe(struct usb_serial_port *port)
2067 {
2068 struct ftdi_private *priv;
2069 const struct ftdi_sio_quirk *quirk = usb_get_serial_data(port->serial);
2070 int result;
2071
2072 priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL);
2073 if (!priv)
2074 return -ENOMEM;
2075
2076 mutex_init(&priv->cfg_lock);
2077
2078 if (quirk && quirk->port_probe)
2079 quirk->port_probe(priv);
2080
2081 usb_set_serial_port_data(port, priv);
2082
2083 ftdi_determine_type(port);
2084 ftdi_set_max_packet_size(port);
2085 if (read_latency_timer(port) < 0)
2086 priv->latency = 16;
2087 write_latency_timer(port);
2088 create_sysfs_attrs(port);
2089
> 2090 result = ftdi_sio_gpio_init(port);
2091 if (result < 0)
2092 dev_err(&port->serial->interface->dev,
2093 "GPIO initialisation failed: %d\n",
2094 result);
2095
2096 return 0;
2097 }
2098
2099 /* Setup for the USB-UIRT device, which requires hardwired
2100 * baudrate (38400 gets mapped to 312500) */
2101 /* Called from usbserial:serial_probe */
2102 static void ftdi_USB_UIRT_setup(struct ftdi_private *priv)
2103 {
2104 priv->flags |= ASYNC_SPD_CUST;
2105 priv->custom_divisor = 77;
2106 priv->force_baud = 38400;
2107 }
2108
2109 /* Setup for the HE-TIRA1 device, which requires hardwired
2110 * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled. */
2111
2112 static void ftdi_HE_TIRA1_setup(struct ftdi_private *priv)
2113 {
2114 priv->flags |= ASYNC_SPD_CUST;
2115 priv->custom_divisor = 240;
2116 priv->force_baud = 38400;
2117 priv->force_rtscts = 1;
2118 }
2119
2120 /*
2121 * Module parameter to control latency timer for NDI FTDI-based USB devices.
2122 * If this value is not set in /etc/modprobe.d/ its value will be set
2123 * to 1ms.
2124 */
2125 static int ndi_latency_timer = 1;
2126
2127 /* Setup for the NDI FTDI-based USB devices, which requires hardwired
2128 * baudrate (19200 gets mapped to 1200000).
2129 *
2130 * Called from usbserial:serial_probe.
2131 */
2132 static int ftdi_NDI_device_setup(struct usb_serial *serial)
2133 {
2134 struct usb_device *udev = serial->dev;
2135 int latency = ndi_latency_timer;
2136
2137 if (latency == 0)
2138 latency = 1;
2139 if (latency > 99)
2140 latency = 99;
2141
2142 dev_dbg(&udev->dev, "%s setting NDI device latency to %d\n", __func__, latency);
2143 dev_info(&udev->dev, "NDI device with a latency value of %d\n", latency);
2144
2145 /* FIXME: errors are not returned */
2146 usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
2147 FTDI_SIO_SET_LATENCY_TIMER_REQUEST,
2148 FTDI_SIO_SET_LATENCY_TIMER_REQUEST_TYPE,
2149 latency, 0, NULL, 0, WDR_TIMEOUT);
2150 return 0;
2151 }
2152
2153 /*
2154 * First port on JTAG adaptors such as Olimex arm-usb-ocd or the FIC/OpenMoko
2155 * Neo1973 Debug Board is reserved for JTAG interface and can be accessed from
2156 * userspace using openocd.
2157 */
2158 static int ftdi_jtag_probe(struct usb_serial *serial)
2159 {
2160 struct usb_device *udev = serial->dev;
2161 struct usb_interface *interface = serial->interface;
2162
2163 if (interface == udev->actconfig->interface[0]) {
2164 dev_info(&udev->dev,
2165 "Ignoring serial port reserved for JTAG\n");
2166 return -ENODEV;
2167 }
2168
2169 return 0;
2170 }
2171
2172 static int ftdi_8u2232c_probe(struct usb_serial *serial)
2173 {
2174 struct usb_device *udev = serial->dev;
2175
2176 if (udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems"))
2177 return ftdi_jtag_probe(serial);
2178
2179 if (udev->product &&
2180 (!strcmp(udev->product, "Arrow USB Blaster") ||
2181 !strcmp(udev->product, "BeagleBone/XDS100V2") ||
2182 !strcmp(udev->product, "SNAP Connect E10")))
2183 return ftdi_jtag_probe(serial);
2184
2185 return 0;
2186 }
2187
2188 /*
2189 * First two ports on JTAG adaptors using an FT4232 such as STMicroelectronics's
2190 * ST Micro Connect Lite are reserved for JTAG or other non-UART interfaces and
2191 * can be accessed from userspace.
2192 * The next two ports are enabled as UARTs by default, where port 2 is
2193 * a conventional RS-232 UART.
2194 */
2195 static int ftdi_stmclite_probe(struct usb_serial *serial)
2196 {
2197 struct usb_device *udev = serial->dev;
2198 struct usb_interface *interface = serial->interface;
2199
2200 if (interface == udev->actconfig->interface[0] ||
2201 interface == udev->actconfig->interface[1]) {
2202 dev_info(&udev->dev, "Ignoring serial port reserved for JTAG\n");
2203 return -ENODEV;
2204 }
2205
2206 return 0;
2207 }
2208
2209 static int ftdi_sio_port_remove(struct usb_serial_port *port)
2210 {
2211 struct ftdi_private *priv = usb_get_serial_port_data(port);
2212
> 2213 ftdi_sio_gpio_remove(port);
2214
2215 remove_sysfs_attrs(port);
2216
2217 kfree(priv);
2218
2219 return 0;
2220 }
2221

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2018-08-28 02:46    [W:0.153 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site