summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2020-02-13 12:13:36 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-13 05:07:10 -0800
commitca065bf12771078571dec758300631624edc19a2 (patch)
tree266b6c413623ef96f8b8b75b97ba7f8acc7a7cbf
parent249fa8217b846a7c031b997bd4ea70d65d3ff774 (diff)
USB: apple-mfi-fastcharge: fix endianess issue in probe
The product ID is little endian and needs to be converted. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Oliver Neukum <oneukum@suse.com> Reviewed-by: Bastien Nocera <hadess@hadess.net> Link: https://lore.kernel.org/r/20200213111336.32392-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/misc/apple-mfi-fastcharge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/misc/apple-mfi-fastcharge.c b/drivers/usb/misc/apple-mfi-fastcharge.c
index f1c4461a9a3c..b403094a6b3a 100644
--- a/drivers/usb/misc/apple-mfi-fastcharge.c
+++ b/drivers/usb/misc/apple-mfi-fastcharge.c
@@ -167,11 +167,11 @@ static int mfi_fc_probe(struct usb_device *udev)
{
struct power_supply_config battery_cfg = {};
struct mfi_device *mfi = NULL;
- int err;
+ int err, idProduct;
+ idProduct = le16_to_cpu(udev->descriptor.idProduct);
/* See comment above mfi_fc_id_table[] */
- if (udev->descriptor.idProduct < 0x1200 ||
- udev->descriptor.idProduct > 0x12ff) {
+ if (idProduct < 0x1200 || idProduct > 0x12ff) {
return -ENODEV;
}