aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ftdi_sio.c
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2017-03-08 11:03:01 -0500
committerJohan Hovold <johan@kernel.org>2017-03-13 11:55:41 -0400
commitf1ce25f292e7ef7a86e44ec4d30a7e179d3ddce0 (patch)
tree134c122621a1d32dd3364595d9136f2b1bee3a59 /drivers/usb/serial/ftdi_sio.c
parentd0559a2f294c9b50d7795a8362931f0db8953de1 (diff)
USB: serial: ftdi_sio: allow other bases for "event_char"
The 'store' function for the "event_char" device attribute currently expects a base 10 value. The value is composed of an enable bit in bit 8 and an 8-bit "event character" code in bits 7 to 0. It seems reasonable to allow hexadecimal and octal numbers to be written to the device attribute in addition to decimal. Make it so. Change the debug message to show the value in hexadecimal, rather than decimal. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r--drivers/usb/serial/ftdi_sio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 4032a675643c..546171289869 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1741,10 +1741,10 @@ static ssize_t store_event_char(struct device *dev,
1741 unsigned int v; 1741 unsigned int v;
1742 int rv; 1742 int rv;
1743 1743
1744 if (kstrtouint(valbuf, 10, &v) || v >= 0x200) 1744 if (kstrtouint(valbuf, 0, &v) || v >= 0x200)
1745 return -EINVAL; 1745 return -EINVAL;
1746 1746
1747 dev_dbg(&port->dev, "%s: setting event char = %i\n", __func__, v); 1747 dev_dbg(&port->dev, "%s: setting event char = 0x%03x\n", __func__, v);
1748 1748
1749 rv = usb_control_msg(udev, 1749 rv = usb_control_msg(udev,
1750 usb_sndctrlpipe(udev, 0), 1750 usb_sndctrlpipe(udev, 0),