aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2010-06-08 04:01:48 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-06-08 04:26:36 -0400
commit1719ec4136035472d3e83a373908dd1b186dbc0b (patch)
treea178a162d10a80bfd8e565e767b10fd2d5301019
parent4aa5bbeca0fe561181e8fba089cd96e449ee5fca (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.c21
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 */
581static int bcm5974_start_traffic(struct bcm5974 *dev) 581static 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
596err_kill_bt: 601err_kill_bt:
597 usb_kill_urb(dev->bt_urb); 602 usb_kill_urb(dev->bt_urb);
598error: 603err_reset_mode:
599 return -EIO; 604 bcm5974_wellspring_mode(dev, false);
605err_out:
606 return error;
600} 607}
601 608
602static void bcm5974_pause_traffic(struct bcm5974 *dev) 609static void bcm5974_pause_traffic(struct bcm5974 *dev)