X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fusb%2Fmisc%2Fusblcd.c;h=da8a43830a822adcac1d82df0f03404128430252;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=9ff010f1a93bba6bb458c56f47e4fd153d24a6f5;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index 9ff010f1a..da8a43830 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c @@ -74,7 +74,7 @@ ioctl_lcd(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { struct lcd_usb_data *lcd = &lcd_instance; - int i; + u16 bcdDevice; char buf[30]; /* Sanity check to make sure lcd is connected, powered, etc */ @@ -85,9 +85,12 @@ ioctl_lcd(struct inode *inode, struct file *file, unsigned int cmd, switch (cmd) { case IOCTL_GET_HARD_VERSION: - i = (lcd->lcd_dev)->descriptor.bcdDevice; - sprintf(buf,"%1d%1d.%1d%1d",(i & 0xF000)>>12,(i & 0xF00)>>8, - (i & 0xF0)>>4,(i & 0xF)); + bcdDevice = le16_to_cpu((lcd->lcd_dev)->descriptor.bcdDevice); + sprintf(buf,"%1d%1d.%1d%1d", + (bcdDevice & 0xF000)>>12, + (bcdDevice & 0xF00)>>8, + (bcdDevice & 0xF0)>>4, + (bcdDevice & 0xF)); if (copy_to_user((void __user *)arg,buf,strlen(buf))!=0) return -EFAULT; break; @@ -258,7 +261,7 @@ static int probe_lcd(struct usb_interface *intf, const struct usb_device_id *id) int i; int retval; - if (dev->descriptor.idProduct != 0x0001 ) { + if (le16_to_cpu(dev->descriptor.idProduct) != 0x0001) { warn(KERN_INFO "USBLCD model not supported."); return -ENODEV; } @@ -268,7 +271,7 @@ static int probe_lcd(struct usb_interface *intf, const struct usb_device_id *id) return -ENODEV; } - i = dev->descriptor.bcdDevice; + i = le16_to_cpu(dev->descriptor.bcdDevice); info("USBLCD Version %1d%1d.%1d%1d found at address %d", (i & 0xF000)>>12,(i & 0xF00)>>8,(i & 0xF0)>>4,(i & 0xF),