aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hidraw.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-03 18:25:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-03 18:25:44 -0400
commit5fba0925fd6b67d94181055b7222e3d934b4efee (patch)
tree167c0e259ec94f426674d3f79563c3e556cda845 /drivers/hid/hidraw.c
parent811158b147a503fbdf9773224004ffd32002d1fe (diff)
parent621de593081524da2f0f7b060f5951b4155eb4a2 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: remove compat stuff HID: constify arrays of struct apple_key_translation HID: add support for Kye/Genius Ergo 525V HID: Support Apple mini aluminum keyboard HID: support for Kensington slimblade device HID: DragonRise game controller force feedback driver HID: add support for another version of 0e8f:0003 device in hid-pl HID: fix race between usb_register_dev() and hiddev_open() HID: bring back possibility to specify vid/pid ignore on module load HID: make HID_DEBUG defaults consistent HID: autosuspend -- fix lockup of hid on reset HID: hid_reset_resume() needs to be defined only when CONFIG_PM is set HID: fix USB HID devices after STD with autosuspend HID: do not try to compile PM code with CONFIG_PM unset HID: autosuspend support for USB HID
Diffstat (limited to 'drivers/hid/hidraw.c')
-rw-r--r--drivers/hid/hidraw.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 02b19db5442e..e263d4731179 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -181,9 +181,17 @@ static int hidraw_open(struct inode *inode, struct file *file)
181 181
182 dev = hidraw_table[minor]; 182 dev = hidraw_table[minor];
183 if (!dev->open++) { 183 if (!dev->open++) {
184 if (dev->hid->ll_driver->power) {
185 err = dev->hid->ll_driver->power(dev->hid, PM_HINT_FULLON);
186 if (err < 0)
187 goto out_unlock;
188 }
184 err = dev->hid->ll_driver->open(dev->hid); 189 err = dev->hid->ll_driver->open(dev->hid);
185 if (err < 0) 190 if (err < 0) {
191 if (dev->hid->ll_driver->power)
192 dev->hid->ll_driver->power(dev->hid, PM_HINT_NORMAL);
186 dev->open--; 193 dev->open--;
194 }
187 } 195 }
188 196
189out_unlock: 197out_unlock:
@@ -209,10 +217,13 @@ static int hidraw_release(struct inode * inode, struct file * file)
209 list_del(&list->node); 217 list_del(&list->node);
210 dev = hidraw_table[minor]; 218 dev = hidraw_table[minor];
211 if (!--dev->open) { 219 if (!--dev->open) {
212 if (list->hidraw->exist) 220 if (list->hidraw->exist) {
221 if (dev->hid->ll_driver->power)
222 dev->hid->ll_driver->power(dev->hid, PM_HINT_NORMAL);
213 dev->hid->ll_driver->close(dev->hid); 223 dev->hid->ll_driver->close(dev->hid);
214 else 224 } else {
215 kfree(list->hidraw); 225 kfree(list->hidraw);
226 }
216 } 227 }
217 228
218 kfree(list); 229 kfree(list);