Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108518
b: refs/heads/master
c: 88da765
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov committed Aug 8, 2008
1 parent bc7422b commit af5d927
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f89bd95c5c946776f116ffeb997653d4193d6a35
refs/heads/master: 88da765f4d5f59f67a7a51c8f5d608a836b32133
12 changes: 12 additions & 0 deletions trunk/drivers/input/mouse/bcm5974.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ struct bcm5974_config {
struct bcm5974 {
char phys[64];
struct usb_device *udev; /* usb device */
struct usb_interface *intf; /* our interface */
struct input_dev *input; /* input dev */
struct bcm5974_config cfg; /* device configuration */
struct mutex pm_mutex; /* serialize access to open/suspend */
Expand Down Expand Up @@ -478,6 +479,10 @@ static int bcm5974_open(struct input_dev *input)
struct bcm5974 *dev = input_get_drvdata(input);
int error;

error = usb_autopm_get_interface(dev->intf);
if (error)
return error;

mutex_lock(&dev->pm_mutex);

error = bcm5974_start_traffic(dev);
Expand All @@ -486,6 +491,9 @@ static int bcm5974_open(struct input_dev *input)

mutex_unlock(&dev->pm_mutex);

if (error)
usb_autopm_put_interface(dev->intf);

return error;
}

Expand All @@ -499,6 +507,8 @@ static void bcm5974_close(struct input_dev *input)
dev->opened = 0;

mutex_unlock(&dev->pm_mutex);

usb_autopm_put_interface(dev->intf);
}

static int bcm5974_suspend(struct usb_interface *iface, pm_message_t message)
Expand Down Expand Up @@ -551,6 +561,7 @@ static int bcm5974_probe(struct usb_interface *iface,
}

dev->udev = udev;
dev->intf = iface;
dev->input = input_dev;
dev->cfg = *cfg;
mutex_init(&dev->pm_mutex);
Expand Down Expand Up @@ -652,6 +663,7 @@ static struct usb_driver bcm5974_driver = {
.resume = bcm5974_resume,
.reset_resume = bcm5974_resume,
.id_table = bcm5974_table,
.supports_autosuspend = 1,
};

static int __init bcm5974_init(void)
Expand Down

0 comments on commit af5d927

Please sign in to comment.