Skip to content

Commit 6fc88f5

Browse files
Oliver Neukumgregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0d22f65 commit 6fc88f5

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

drivers/input/joystick/xpad.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,11 @@ static void xpad360_process_packet(struct usb_xpad *xpad,
339339
static void xpad_irq_in(struct urb *urb)
340340
{
341341
struct usb_xpad *xpad = urb->context;
342-
int retval;
342+
int retval, status;
343343

344-
switch (urb->status) {
344+
status = urb->status;
345+
346+
switch (status) {
345347
case 0:
346348
/* success */
347349
break;
@@ -350,11 +352,11 @@ static void xpad_irq_in(struct urb *urb)
350352
case -ESHUTDOWN:
351353
/* this urb is terminated, clean up */
352354
dbg("%s - urb shutting down with status: %d",
353-
__FUNCTION__, urb->status);
355+
__FUNCTION__, status);
354356
return;
355357
default:
356358
dbg("%s - nonzero urb status received: %d",
357-
__FUNCTION__, urb->status);
359+
__FUNCTION__, status);
358360
goto exit;
359361
}
360362

@@ -373,9 +375,11 @@ static void xpad_irq_in(struct urb *urb)
373375
#if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS)
374376
static void xpad_irq_out(struct urb *urb)
375377
{
376-
int retval;
378+
int retval, status;
379+
380+
status = urb->status;
377381

378-
switch (urb->status) {
382+
switch (status) {
379383
case 0:
380384
/* success */
381385
break;
@@ -384,11 +388,11 @@ static void xpad_irq_out(struct urb *urb)
384388
case -ESHUTDOWN:
385389
/* this urb is terminated, clean up */
386390
dbg("%s - urb shutting down with status: %d",
387-
__FUNCTION__, urb->status);
391+
__FUNCTION__, status);
388392
return;
389393
default:
390394
dbg("%s - nonzero urb status received: %d",
391-
__FUNCTION__, urb->status);
395+
__FUNCTION__, status);
392396
goto exit;
393397
}
394398

0 commit comments

Comments
 (0)