diff options
Diffstat (limited to 'drivers/usb/core/devio.c')
| -rw-r--r-- | drivers/usb/core/devio.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 6585f527e381..df3c539f652a 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
| @@ -104,7 +104,7 @@ MODULE_PARM_DESC(usbfs_snoop, "true to log all usbfs traffic"); | |||
| 104 | 104 | ||
| 105 | #define MAX_USBFS_BUFFER_SIZE 16384 | 105 | #define MAX_USBFS_BUFFER_SIZE 16384 |
| 106 | 106 | ||
| 107 | static inline int connected(struct dev_state *ps) | 107 | static int connected(struct dev_state *ps) |
| 108 | { | 108 | { |
| 109 | return (!list_empty(&ps->list) && | 109 | return (!list_empty(&ps->list) && |
| 110 | ps->dev->state != USB_STATE_NOTATTACHED); | 110 | ps->dev->state != USB_STATE_NOTATTACHED); |
| @@ -248,7 +248,7 @@ static void free_async(struct async *as) | |||
| 248 | kfree(as); | 248 | kfree(as); |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | static inline void async_newpending(struct async *as) | 251 | static void async_newpending(struct async *as) |
| 252 | { | 252 | { |
| 253 | struct dev_state *ps = as->ps; | 253 | struct dev_state *ps = as->ps; |
| 254 | unsigned long flags; | 254 | unsigned long flags; |
| @@ -258,7 +258,7 @@ static inline void async_newpending(struct async *as) | |||
| 258 | spin_unlock_irqrestore(&ps->lock, flags); | 258 | spin_unlock_irqrestore(&ps->lock, flags); |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | static inline void async_removepending(struct async *as) | 261 | static void async_removepending(struct async *as) |
| 262 | { | 262 | { |
| 263 | struct dev_state *ps = as->ps; | 263 | struct dev_state *ps = as->ps; |
| 264 | unsigned long flags; | 264 | unsigned long flags; |
| @@ -268,7 +268,7 @@ static inline void async_removepending(struct async *as) | |||
| 268 | spin_unlock_irqrestore(&ps->lock, flags); | 268 | spin_unlock_irqrestore(&ps->lock, flags); |
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | static inline struct async *async_getcompleted(struct dev_state *ps) | 271 | static struct async *async_getcompleted(struct dev_state *ps) |
| 272 | { | 272 | { |
| 273 | unsigned long flags; | 273 | unsigned long flags; |
| 274 | struct async *as = NULL; | 274 | struct async *as = NULL; |
| @@ -283,7 +283,7 @@ static inline struct async *async_getcompleted(struct dev_state *ps) | |||
| 283 | return as; | 283 | return as; |
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | static inline struct async *async_getpending(struct dev_state *ps, | 286 | static struct async *async_getpending(struct dev_state *ps, |
| 287 | void __user *userurb) | 287 | void __user *userurb) |
| 288 | { | 288 | { |
| 289 | unsigned long flags; | 289 | unsigned long flags; |
| @@ -302,7 +302,7 @@ static inline struct async *async_getpending(struct dev_state *ps, | |||
| 302 | 302 | ||
| 303 | static void snoop_urb(struct urb *urb, void __user *userurb) | 303 | static void snoop_urb(struct urb *urb, void __user *userurb) |
| 304 | { | 304 | { |
| 305 | int j; | 305 | unsigned j; |
| 306 | unsigned char *data = urb->transfer_buffer; | 306 | unsigned char *data = urb->transfer_buffer; |
| 307 | 307 | ||
| 308 | if (!usbfs_snoop) | 308 | if (!usbfs_snoop) |
| @@ -311,9 +311,9 @@ static void snoop_urb(struct urb *urb, void __user *userurb) | |||
| 311 | dev_info(&urb->dev->dev, "direction=%s\n", | 311 | dev_info(&urb->dev->dev, "direction=%s\n", |
| 312 | usb_urb_dir_in(urb) ? "IN" : "OUT"); | 312 | usb_urb_dir_in(urb) ? "IN" : "OUT"); |
| 313 | dev_info(&urb->dev->dev, "userurb=%p\n", userurb); | 313 | dev_info(&urb->dev->dev, "userurb=%p\n", userurb); |
| 314 | dev_info(&urb->dev->dev, "transfer_buffer_length=%d\n", | 314 | dev_info(&urb->dev->dev, "transfer_buffer_length=%u\n", |
| 315 | urb->transfer_buffer_length); | 315 | urb->transfer_buffer_length); |
| 316 | dev_info(&urb->dev->dev, "actual_length=%d\n", urb->actual_length); | 316 | dev_info(&urb->dev->dev, "actual_length=%u\n", urb->actual_length); |
| 317 | dev_info(&urb->dev->dev, "data: "); | 317 | dev_info(&urb->dev->dev, "data: "); |
| 318 | for (j = 0; j < urb->transfer_buffer_length; ++j) | 318 | for (j = 0; j < urb->transfer_buffer_length; ++j) |
| 319 | printk("%02x ", data[j]); | 319 | printk("%02x ", data[j]); |
| @@ -376,7 +376,7 @@ static void destroy_async_on_interface(struct dev_state *ps, | |||
| 376 | destroy_async(ps, &hitlist); | 376 | destroy_async(ps, &hitlist); |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | static inline void destroy_all_async(struct dev_state *ps) | 379 | static void destroy_all_async(struct dev_state *ps) |
| 380 | { | 380 | { |
| 381 | destroy_async(ps, &ps->async_pending); | 381 | destroy_async(ps, &ps->async_pending); |
| 382 | } | 382 | } |
| @@ -525,7 +525,8 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, | |||
| 525 | { | 525 | { |
| 526 | int ret = 0; | 526 | int ret = 0; |
| 527 | 527 | ||
| 528 | if (ps->dev->state != USB_STATE_ADDRESS | 528 | if (ps->dev->state != USB_STATE_UNAUTHENTICATED |
| 529 | && ps->dev->state != USB_STATE_ADDRESS | ||
| 529 | && ps->dev->state != USB_STATE_CONFIGURED) | 530 | && ps->dev->state != USB_STATE_CONFIGURED) |
| 530 | return -EHOSTUNREACH; | 531 | return -EHOSTUNREACH; |
| 531 | if (USB_TYPE_VENDOR == (USB_TYPE_MASK & requesttype)) | 532 | if (USB_TYPE_VENDOR == (USB_TYPE_MASK & requesttype)) |
