diff options
author | Luo Jinghua <sunmoon1997@gmail.com> | 2010-06-08 04:01:48 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-06-08 04:26:36 -0400 |
commit | 1719ec4136035472d3e83a373908dd1b186dbc0b (patch) | |
tree | a178a162d10a80bfd8e565e767b10fd2d5301019 | |
parent | 4aa5bbeca0fe561181e8fba089cd96e449ee5fca (diff) |
Input: bcm5974 - turn wellspring mode off if failed to start traffic
If we fail to submit URBs we should take touchpad out of wellsping
mode.
Signed-off-by: Luo Jinghua <sunmoon1997@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r-- | drivers/input/mouse/bcm5974.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 6dedded27222..354c578ec9d3 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
@@ -580,23 +580,30 @@ exit: | |||
580 | */ | 580 | */ |
581 | static int bcm5974_start_traffic(struct bcm5974 *dev) | 581 | static int bcm5974_start_traffic(struct bcm5974 *dev) |
582 | { | 582 | { |
583 | if (bcm5974_wellspring_mode(dev, true)) { | 583 | int error; |
584 | |||
585 | error = bcm5974_wellspring_mode(dev, true); | ||
586 | if (error) { | ||
584 | dprintk(1, "bcm5974: mode switch failed\n"); | 587 | dprintk(1, "bcm5974: mode switch failed\n"); |
585 | goto error; | 588 | goto err_out; |
586 | } | 589 | } |
587 | 590 | ||
588 | if (usb_submit_urb(dev->bt_urb, GFP_KERNEL)) | 591 | error = usb_submit_urb(dev->bt_urb, GFP_KERNEL); |
589 | goto error; | 592 | if (error) |
593 | goto err_reset_mode; | ||
590 | 594 | ||
591 | if (usb_submit_urb(dev->tp_urb, GFP_KERNEL)) | 595 | error = usb_submit_urb(dev->tp_urb, GFP_KERNEL); |
596 | if (error) | ||
592 | goto err_kill_bt; | 597 | goto err_kill_bt; |
593 | 598 | ||
594 | return 0; | 599 | return 0; |
595 | 600 | ||
596 | err_kill_bt: | 601 | err_kill_bt: |
597 | usb_kill_urb(dev->bt_urb); | 602 | usb_kill_urb(dev->bt_urb); |
598 | error: | 603 | err_reset_mode: |
599 | return -EIO; | 604 | bcm5974_wellspring_mode(dev, false); |
605 | err_out: | ||
606 | return error; | ||
600 | } | 607 | } |
601 | 608 | ||
602 | static void bcm5974_pause_traffic(struct bcm5974 *dev) | 609 | static void bcm5974_pause_traffic(struct bcm5974 *dev) |