Changes in uspace/drv/usbhid/main.c [b20de1d:31cfee16] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/main.c
rb20de1d r31cfee16 99 99 usb_log_debug("USB/HID device structure initialized.\n"); 100 100 101 /* Create the function exposed under /dev/devices. */102 ddf_fun_t *hid_fun = ddf_fun_create(dev->ddf_dev, fun_exposed,103 usb_hid_get_function_name(hid_dev));104 if (hid_fun == NULL) {105 usb_log_error("Could not create DDF function node.\n");106 usb_hid_free(&hid_dev);107 return ENOMEM;108 }109 110 /*111 * Store the initialized HID device and HID ops112 * to the DDF function.113 */114 hid_fun->ops = &hid_dev->ops;115 hid_fun->driver_data = hid_dev; // TODO: maybe change to hid_dev->data116 117 101 /* 118 102 * 1) subdriver vytvori vlastnu ddf_fun, vlastne ddf_dev_ops, ktore da … … 125 109 * pouzit usb/classes/hid/iface.h - prvy int je telefon 126 110 */ 127 128 rc = ddf_fun_bind(hid_fun);129 if (rc != EOK) {130 usb_log_error("Could not bind DDF function: %s.\n",131 str_error(rc));132 // TODO: Can / should I destroy the DDF function?133 ddf_fun_destroy(hid_fun);134 usb_hid_free(&hid_dev);135 return rc;136 }137 138 rc = ddf_fun_add_to_class(hid_fun, usb_hid_get_class_name(hid_dev));139 if (rc != EOK) {140 usb_log_error(141 "Could not add DDF function to class 'hid': %s.\n",142 str_error(rc));143 // TODO: Can / should I destroy the DDF function?144 ddf_fun_destroy(hid_fun);145 usb_hid_free(&hid_dev);146 return rc;147 }148 111 149 112 /* Start automated polling function.
Note:
See TracChangeset
for help on using the changeset viewer.