linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] apple-mfi-fastcharge: fix endianess issue in probe
@ 2020-02-13 11:13 Oliver Neukum
  2020-02-13 11:16 ` Bastien Nocera
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Neukum @ 2020-02-13 11:13 UTC (permalink / raw)
  To: hadess, gregkh, linux-usb; +Cc: Oliver Neukum

The product ID is little endian and needs to be converted.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reported-by: kbuild test robot <lkp@intel.com>
---
 drivers/usb/misc/apple-mfi-fastcharge.c | 6 +++---
 1 file 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;
 	}
 
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] apple-mfi-fastcharge: fix endianess issue in probe
  2020-02-13 11:13 [PATCH] apple-mfi-fastcharge: fix endianess issue in probe Oliver Neukum
@ 2020-02-13 11:16 ` Bastien Nocera
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien Nocera @ 2020-02-13 11:16 UTC (permalink / raw)
  To: Oliver Neukum, gregkh, linux-usb

On Thu, 2020-02-13 at 12:13 +0100, Oliver Neukum wrote:
> The product ID is little endian and needs to be converted.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> Reported-by: kbuild test robot <lkp@intel.com>

Looks good, thanks for the quick fix!

Reviewed-by: Bastien Nocera <hadess@hadess.net>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-13 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13 11:13 [PATCH] apple-mfi-fastcharge: fix endianess issue in probe Oliver Neukum
2020-02-13 11:16 ` Bastien Nocera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).