mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-18 12:45:08 +00:00
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>
This commit is contained in:
parent
d0559a2f29
commit
f1ce25f292
1 changed files with 2 additions and 2 deletions
|
@ -1741,10 +1741,10 @@ static ssize_t store_event_char(struct device *dev,
|
|||
unsigned int v;
|
||||
int rv;
|
||||
|
||||
if (kstrtouint(valbuf, 10, &v) || v >= 0x200)
|
||||
if (kstrtouint(valbuf, 0, &v) || v >= 0x200)
|
||||
return -EINVAL;
|
||||
|
||||
dev_dbg(&port->dev, "%s: setting event char = %i\n", __func__, v);
|
||||
dev_dbg(&port->dev, "%s: setting event char = 0x%03x\n", __func__, v);
|
||||
|
||||
rv = usb_control_msg(udev,
|
||||
usb_sndctrlpipe(udev, 0),
|
||||
|
|
Loading…
Add table
Reference in a new issue