Changes in uspace/drv/usbhid/main.c [31cfee16:b20de1d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/main.c
r31cfee16 rb20de1d 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 ops 112 * 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->data 116 101 117 /* 102 118 * 1) subdriver vytvori vlastnu ddf_fun, vlastne ddf_dev_ops, ktore da … … 109 125 * pouzit usb/classes/hid/iface.h - prvy int je telefon 110 126 */ 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 } 111 148 112 149 /* Start automated polling function.
Note:
See TracChangeset
for help on using the changeset viewer.