apple-mfi-fastcharge: fix endianess issue in probe
Subsystems (2)
PATCH 1/1 apple-mfi-fastcharge: fix endianess issue in probe
The product ID is little endian and needs to be converted.
Signed-off-by Oliver Neukum <[email protected]>
Reported-by kbuild test robot <[email protected]>
--- drivers/usb/misc/apple-mfi-fastcharge.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/misc/apple-mfi-fastcharge.c +3 -3
@@ -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 ; }
Signature · 1 line
2.16.4
Quoted 4 lines · Oliver Neukum
The product ID is little endian and needs to be converted.
Signed-off-by Oliver Neukum <[email protected]>Reported-by kbuild test robot <[email protected]>
Looks good, thanks for the quick fix!
Reviewed-by Bastien Nocera <[email protected]>