diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-09-07 14:31:45 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-10 11:13:16 -0700 |
commit | b53d657d84f530e5d83f34ff1b81ceedad3faa31 (patch) | |
tree | f7921ce311aca66d7f42031e3a6e0cd31a808ea9 /lib/bcd.c | |
parent | 8a424bf40d772fedacc91862ecc86f10541fabb3 (diff) | |
download | linux-b53d657d84f530e5d83f34ff1b81ceedad3faa31.tar.bz2 |
usb/core: use bin2bcd() for bcdDevice in RH
The kernel's version number is used as decimal in the bcdDevice field of
the RH descriptor. For kernel version v3.12 we would see 3.0c in lsusb.
I am not sure how important it is to stick with bcd values since this is
this way since we started git history and nobody complained (however back
then we reported only 2.6).
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/bcd.c')
-rw-r--r-- | lib/bcd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bcd.c b/lib/bcd.c index 55efaf742346..40d304efe272 100644 --- a/lib/bcd.c +++ b/lib/bcd.c @@ -1,14 +1,14 @@ #include <linux/bcd.h> #include <linux/export.h> -unsigned bcd2bin(unsigned char val) +unsigned _bcd2bin(unsigned char val) { return (val & 0x0f) + (val >> 4) * 10; } -EXPORT_SYMBOL(bcd2bin); +EXPORT_SYMBOL(_bcd2bin); -unsigned char bin2bcd(unsigned val) +unsigned char _bin2bcd(unsigned val) { return ((val / 10) << 4) + val % 10; } -EXPORT_SYMBOL(bin2bcd); +EXPORT_SYMBOL(_bin2bcd); |