On 02/03/17 14:37, Johan Hovold wrote:
On Tue, Feb 28, 2017 at 12:51:28PM +0000, Ian Abbott wrote:
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.

Signed-off-by: Ian Abbott <abbo...@mev.co.uk>
---
 drivers/usb/serial/ftdi_sio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index e6785d84280b..a007ec8238eb 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1742,7 +1742,7 @@ static ssize_t store_event_char(struct device *dev,
        unsigned int v;
        int rv;

-       rv = kstrtouint(valbuf, 10, &v);
+       rv = kstrtouint(valbuf, 0, &v);
        if (rv)
                return rv;

How about changing the debug printk just below to use "0x%02x" as well?

Okay, although "0x%03x" would be better since it's a 9-bit value.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbo...@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to