aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hidraw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hidraw.c')
-rw-r--r--drivers/hid/hidraw.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 8a4b32dca9f..5aefe73cf79 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -193,15 +193,13 @@ static int hidraw_open(struct inode *inode, struct file *file)
193 193
194 dev = hidraw_table[minor]; 194 dev = hidraw_table[minor];
195 if (!dev->open++) { 195 if (!dev->open++) {
196 if (dev->hid->ll_driver->power) { 196 err = hid_hw_power(dev->hid, PM_HINT_FULLON);
197 err = dev->hid->ll_driver->power(dev->hid, PM_HINT_FULLON); 197 if (err < 0)
198 if (err < 0) 198 goto out_unlock;
199 goto out_unlock; 199
200 } 200 err = hid_hw_open(dev->hid);
201 err = dev->hid->ll_driver->open(dev->hid);
202 if (err < 0) { 201 if (err < 0) {
203 if (dev->hid->ll_driver->power) 202 hid_hw_power(dev->hid, PM_HINT_NORMAL);
204 dev->hid->ll_driver->power(dev->hid, PM_HINT_NORMAL);
205 dev->open--; 203 dev->open--;
206 } 204 }
207 } 205 }
@@ -230,9 +228,8 @@ static int hidraw_release(struct inode * inode, struct file * file)
230 dev = hidraw_table[minor]; 228 dev = hidraw_table[minor];
231 if (!--dev->open) { 229 if (!--dev->open) {
232 if (list->hidraw->exist) { 230 if (list->hidraw->exist) {
233 if (dev->hid->ll_driver->power) 231 hid_hw_power(dev->hid, PM_HINT_NORMAL);
234 dev->hid->ll_driver->power(dev->hid, PM_HINT_NORMAL); 232 hid_hw_close(dev->hid);
235 dev->hid->ll_driver->close(dev->hid);
236 } else { 233 } else {
237 kfree(list->hidraw); 234 kfree(list->hidraw);
238 } 235 }
@@ -434,7 +431,7 @@ void hidraw_disconnect(struct hid_device *hid)
434 device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor)); 431 device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor));
435 432
436 if (hidraw->open) { 433 if (hidraw->open) {
437 hid->ll_driver->close(hid); 434 hid_hw_close(hid);
438 wake_up_interruptible(&hidraw->wait); 435 wake_up_interruptible(&hidraw->wait);
439 } else { 436 } else {
440 kfree(hidraw); 437 kfree(hidraw);