Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: convert away from urb->status in xpad driver

USB is moving to transfering status as a parameter. To ease the transition
urb->status is to be touched only once in a function. The xpad driver has
been overlooked. Dmitry wants this to go through the USB tree.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Oliver Neukum and committed by
Greg Kroah-Hartman
6fc88f53 0d22f655

+12 -8
+12 -8
drivers/input/joystick/xpad.c
··· 339 339 static void xpad_irq_in(struct urb *urb) 340 340 { 341 341 struct usb_xpad *xpad = urb->context; 342 - int retval; 342 + int retval, status; 343 343 344 - switch (urb->status) { 344 + status = urb->status; 345 + 346 + switch (status) { 345 347 case 0: 346 348 /* success */ 347 349 break; ··· 352 350 case -ESHUTDOWN: 353 351 /* this urb is terminated, clean up */ 354 352 dbg("%s - urb shutting down with status: %d", 355 - __FUNCTION__, urb->status); 353 + __FUNCTION__, status); 356 354 return; 357 355 default: 358 356 dbg("%s - nonzero urb status received: %d", 359 - __FUNCTION__, urb->status); 357 + __FUNCTION__, status); 360 358 goto exit; 361 359 } 362 360 ··· 375 373 #if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS) 376 374 static void xpad_irq_out(struct urb *urb) 377 375 { 378 - int retval; 376 + int retval, status; 379 377 380 - switch (urb->status) { 378 + status = urb->status; 379 + 380 + switch (status) { 381 381 case 0: 382 382 /* success */ 383 383 break; ··· 388 384 case -ESHUTDOWN: 389 385 /* this urb is terminated, clean up */ 390 386 dbg("%s - urb shutting down with status: %d", 391 - __FUNCTION__, urb->status); 387 + __FUNCTION__, status); 392 388 return; 393 389 default: 394 390 dbg("%s - nonzero urb status received: %d", 395 - __FUNCTION__, urb->status); 391 + __FUNCTION__, status); 396 392 goto exit; 397 393 } 398 394