return result;
}
-int usbhid_open(struct hid_device *hid)
+static int usbhid_open(struct hid_device *hid)
{
struct usbhid_device *usbhid = hid->driver_data;
int res = 0;
return res;
}
-void usbhid_close(struct hid_device *hid)
+static void usbhid_close(struct hid_device *hid)
{
struct usbhid_device *usbhid = hid->driver_data;
mutex_lock(&list->hiddev->existancelock);
if (!--list->hiddev->open) {
if (list->hiddev->exist) {
- usbhid_close(list->hiddev->hid);
+ hid_hw_close(list->hiddev->hid);
usbhid_put_power(list->hiddev->hid);
} else {
mutex_unlock(&list->hiddev->existancelock);
*/
if (list->hiddev->exist) {
if (!list->hiddev->open++) {
- res = usbhid_open(hiddev->hid);
- if (res < 0) {
- res = -EIO;
+ res = hid_hw_open(hiddev->hid);
+ if (res < 0)
goto bail;
- }
}
} else {
res = -ENODEV;
res = -EIO;
goto bail_unlock;
}
- usbhid_open(hid);
+ res = hid_hw_open(hid);
+ if (res < 0)
+ goto bail_put_power;
}
mutex_unlock(&hiddev->existancelock);
return 0;
+bail_put_power:
+ usbhid_put_power(hid);
bail_unlock:
mutex_unlock(&hiddev->existancelock);
bail:
if (hiddev->open) {
mutex_unlock(&hiddev->existancelock);
- usbhid_close(hiddev->hid);
+ hid_hw_close(hiddev->hid);
wake_up_interruptible(&hiddev->wait);
} else {
mutex_unlock(&hiddev->existancelock);
#include <linux/input.h>
/* API provided by hid-core.c for USB HID drivers */
-void usbhid_close(struct hid_device *hid);
-int usbhid_open(struct hid_device *hid);
void usbhid_init_reports(struct hid_device *hid);
int usbhid_get_power(struct hid_device *hid);
void usbhid_put_power(struct hid_device *hid);