aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-07-12 16:50:12 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 17:35:39 -0400
commit5bd6e8b3fb787b7337b681aaa601e5c7bdc67c55 (patch)
treef83107e0a01ebe6786a392a85acfaa3f82f2b822 /drivers/usb/misc
parente53e841d451a2d0da094b8fea4a7f22b296234f6 (diff)
USB: misc: Remove unnecessary casts of private_data
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/ftdi-elan.c4
-rw-r--r--drivers/usb/misc/iowarrior.c8
-rw-r--r--drivers/usb/misc/legousbtower.c6
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb.c10
-rw-r--r--drivers/usb/misc/usblcd.c8
5 files changed, 18 insertions, 18 deletions
diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 82e16630a78b..aecf380f6ecc 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -650,7 +650,7 @@ static int ftdi_elan_open(struct inode *inode, struct file *file)
650 650
651static int ftdi_elan_release(struct inode *inode, struct file *file) 651static int ftdi_elan_release(struct inode *inode, struct file *file)
652{ 652{
653 struct usb_ftdi *ftdi = (struct usb_ftdi *)file->private_data; 653 struct usb_ftdi *ftdi = file->private_data;
654 if (ftdi == NULL) 654 if (ftdi == NULL)
655 return -ENODEV; 655 return -ENODEV;
656 up(&ftdi->sw_lock); /* decrement the count on our device */ 656 up(&ftdi->sw_lock); /* decrement the count on our device */
@@ -673,7 +673,7 @@ static ssize_t ftdi_elan_read(struct file *file, char __user *buffer,
673 int bytes_read = 0; 673 int bytes_read = 0;
674 int retry_on_empty = 10; 674 int retry_on_empty = 10;
675 int retry_on_timeout = 5; 675 int retry_on_timeout = 5;
676 struct usb_ftdi *ftdi = (struct usb_ftdi *)file->private_data; 676 struct usb_ftdi *ftdi = file->private_data;
677 if (ftdi->disconnected > 0) { 677 if (ftdi->disconnected > 0) {
678 return -ENODEV; 678 return -ENODEV;
679 } 679 }
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 82966458a004..2de49c8887c5 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -283,7 +283,7 @@ static ssize_t iowarrior_read(struct file *file, char __user *buffer,
283 int read_idx; 283 int read_idx;
284 int offset; 284 int offset;
285 285
286 dev = (struct iowarrior *)file->private_data; 286 dev = file->private_data;
287 287
288 /* verify that the device wasn't unplugged */ 288 /* verify that the device wasn't unplugged */
289 if (dev == NULL || !dev->present) 289 if (dev == NULL || !dev->present)
@@ -349,7 +349,7 @@ static ssize_t iowarrior_write(struct file *file,
349 char *buf = NULL; /* for IOW24 and IOW56 we need a buffer */ 349 char *buf = NULL; /* for IOW24 and IOW56 we need a buffer */
350 struct urb *int_out_urb = NULL; 350 struct urb *int_out_urb = NULL;
351 351
352 dev = (struct iowarrior *)file->private_data; 352 dev = file->private_data;
353 353
354 mutex_lock(&dev->mutex); 354 mutex_lock(&dev->mutex);
355 /* verify that the device wasn't unplugged */ 355 /* verify that the device wasn't unplugged */
@@ -484,7 +484,7 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd,
484 int retval; 484 int retval;
485 int io_res; /* checks for bytes read/written and copy_to/from_user results */ 485 int io_res; /* checks for bytes read/written and copy_to/from_user results */
486 486
487 dev = (struct iowarrior *)file->private_data; 487 dev = file->private_data;
488 if (dev == NULL) { 488 if (dev == NULL) {
489 return -ENODEV; 489 return -ENODEV;
490 } 490 }
@@ -657,7 +657,7 @@ static int iowarrior_release(struct inode *inode, struct file *file)
657 struct iowarrior *dev; 657 struct iowarrior *dev;
658 int retval = 0; 658 int retval = 0;
659 659
660 dev = (struct iowarrior *)file->private_data; 660 dev = file->private_data;
661 if (dev == NULL) { 661 if (dev == NULL) {
662 return -ENODEV; 662 return -ENODEV;
663 } 663 }
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index 8547bf9e3175..6482c6e2e6bd 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -448,7 +448,7 @@ static int tower_release (struct inode *inode, struct file *file)
448 448
449 dbg(2, "%s: enter", __func__); 449 dbg(2, "%s: enter", __func__);
450 450
451 dev = (struct lego_usb_tower *)file->private_data; 451 dev = file->private_data;
452 452
453 if (dev == NULL) { 453 if (dev == NULL) {
454 dbg(1, "%s: object is NULL", __func__); 454 dbg(1, "%s: object is NULL", __func__);
@@ -597,7 +597,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count,
597 597
598 dbg(2, "%s: enter, count = %Zd", __func__, count); 598 dbg(2, "%s: enter, count = %Zd", __func__, count);
599 599
600 dev = (struct lego_usb_tower *)file->private_data; 600 dev = file->private_data;
601 601
602 /* lock this object */ 602 /* lock this object */
603 if (mutex_lock_interruptible(&dev->lock)) { 603 if (mutex_lock_interruptible(&dev->lock)) {
@@ -686,7 +686,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
686 686
687 dbg(2, "%s: enter, count = %Zd", __func__, count); 687 dbg(2, "%s: enter, count = %Zd", __func__, count);
688 688
689 dev = (struct lego_usb_tower *)file->private_data; 689 dev = file->private_data;
690 690
691 /* lock this object */ 691 /* lock this object */
692 if (mutex_lock_interruptible(&dev->lock)) { 692 if (mutex_lock_interruptible(&dev->lock)) {
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index d25814c172b2..70d00e99a4b4 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -2487,7 +2487,7 @@ sisusb_release(struct inode *inode, struct file *file)
2487{ 2487{
2488 struct sisusb_usb_data *sisusb; 2488 struct sisusb_usb_data *sisusb;
2489 2489
2490 if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) 2490 if (!(sisusb = file->private_data))
2491 return -ENODEV; 2491 return -ENODEV;
2492 2492
2493 mutex_lock(&sisusb->lock); 2493 mutex_lock(&sisusb->lock);
@@ -2519,7 +2519,7 @@ sisusb_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
2519 u16 buf16; 2519 u16 buf16;
2520 u32 buf32, address; 2520 u32 buf32, address;
2521 2521
2522 if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) 2522 if (!(sisusb = file->private_data))
2523 return -ENODEV; 2523 return -ENODEV;
2524 2524
2525 mutex_lock(&sisusb->lock); 2525 mutex_lock(&sisusb->lock);
@@ -2661,7 +2661,7 @@ sisusb_write(struct file *file, const char __user *buffer, size_t count,
2661 u16 buf16; 2661 u16 buf16;
2662 u32 buf32, address; 2662 u32 buf32, address;
2663 2663
2664 if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) 2664 if (!(sisusb = file->private_data))
2665 return -ENODEV; 2665 return -ENODEV;
2666 2666
2667 mutex_lock(&sisusb->lock); 2667 mutex_lock(&sisusb->lock);
@@ -2804,7 +2804,7 @@ sisusb_lseek(struct file *file, loff_t offset, int orig)
2804 struct sisusb_usb_data *sisusb; 2804 struct sisusb_usb_data *sisusb;
2805 loff_t ret; 2805 loff_t ret;
2806 2806
2807 if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) 2807 if (!(sisusb = file->private_data))
2808 return -ENODEV; 2808 return -ENODEV;
2809 2809
2810 mutex_lock(&sisusb->lock); 2810 mutex_lock(&sisusb->lock);
@@ -2969,7 +2969,7 @@ sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2969 long retval = 0; 2969 long retval = 0;
2970 u32 __user *argp = (u32 __user *)arg; 2970 u32 __user *argp = (u32 __user *)arg;
2971 2971
2972 if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) 2972 if (!(sisusb = file->private_data))
2973 return -ENODEV; 2973 return -ENODEV;
2974 2974
2975 mutex_lock(&sisusb->lock); 2975 mutex_lock(&sisusb->lock);
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 6ae39e3e5046..d00dde19194c 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -116,7 +116,7 @@ static int lcd_release(struct inode *inode, struct file *file)
116{ 116{
117 struct usb_lcd *dev; 117 struct usb_lcd *dev;
118 118
119 dev = (struct usb_lcd *)file->private_data; 119 dev = file->private_data;
120 if (dev == NULL) 120 if (dev == NULL)
121 return -ENODEV; 121 return -ENODEV;
122 122
@@ -132,7 +132,7 @@ static ssize_t lcd_read(struct file *file, char __user * buffer, size_t count, l
132 int retval = 0; 132 int retval = 0;
133 int bytes_read; 133 int bytes_read;
134 134
135 dev = (struct usb_lcd *)file->private_data; 135 dev = file->private_data;
136 136
137 /* do a blocking bulk read to get data from the device */ 137 /* do a blocking bulk read to get data from the device */
138 retval = usb_bulk_msg(dev->udev, 138 retval = usb_bulk_msg(dev->udev,
@@ -158,7 +158,7 @@ static long lcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
158 u16 bcdDevice; 158 u16 bcdDevice;
159 char buf[30]; 159 char buf[30];
160 160
161 dev = (struct usb_lcd *)file->private_data; 161 dev = file->private_data;
162 if (dev == NULL) 162 if (dev == NULL)
163 return -ENODEV; 163 return -ENODEV;
164 164
@@ -217,7 +217,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz
217 struct urb *urb = NULL; 217 struct urb *urb = NULL;
218 char *buf = NULL; 218 char *buf = NULL;
219 219
220 dev = (struct usb_lcd *)file->private_data; 220 dev = file->private_data;
221 221
222 /* verify that we actually have some data to write */ 222 /* verify that we actually have some data to write */
223 if (count == 0) 223 if (count == 0)