Driver for MaxLinear/Exar USB (UART) Serial Adapters
Greg Kroah-Hartman
maintainerQuoted 11 lines · Patong Yang
The original driver/patch was submitted on April 4, 2018. This is the second version based on the feedback received on the original patch.
v2: Removed custom IOCTLs, as suggested by Greg KH
Using standard Linux GPIO APIs, as suggested by Greg KH Removed file reads/writes as suggested by Greg KHSigned-off-by Patong Yang <[email protected]>--- drivers/usb/serial/xrusb_serial.c | 2380 +++++++++++++++++++++++++++++ drivers/usb/serial/xrusb_serial.h | 234 +++
Why do you need a .h file for a single driver? Please just put it all into one file.
But there is a bigger problem here:
Review
Quoted 3 lines
(quoted diff) +3
-0+ xrusb_tty_driver = alloc_tty_driver(XRUSB_TTY_MINORS); + if (!xrusb_tty_driver) + return -ENOMEM;
Why are you not using the usb serial core here? You need to do that, not try to provide your own custom tty driver. That way userspace programs will "just work" with your new device, no changes needed as your major/minor number and device name would be custom only for your device, which is not acceptable.
By doing that, your code will also be much smaller, always a good benefit as well.
thanks,
greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html