Changeset c5b6db53 in mainline
- Timestamp:
- 2011-10-14T15:22:12Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f2964e45
- Parents:
- af8c9b54
- Location:
- uspace/drv/bus/usb/usbhid
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhid/generic/hiddev.c
raf8c9b54 rc5b6db53 190 190 /*----------------------------------------------------------------------------*/ 191 191 192 static int usb_generic_hid_create_function(usb_hid_dev_t *hid_dev) 193 { 192 void usb_generic_hid_deinit(usb_hid_dev_t *hid_dev, void *data) 193 { 194 ddf_fun_t *fun = data; 195 const int ret = ddf_fun_unbind(fun); 196 if (ret != EOK) { 197 usb_log_error("ailed to unbind generic hid fun.\n"); 198 return; 199 } 200 ddf_fun_destroy(fun); 201 } 202 203 /*----------------------------------------------------------------------------*/ 204 205 int usb_generic_hid_init(usb_hid_dev_t *hid_dev, void **data) 206 { 207 if (hid_dev == NULL) { 208 return EINVAL; 209 } 210 194 211 /* Create the exposed function. */ 195 212 /** @todo Generate numbers for the devices? */ … … 214 231 215 232 usb_log_debug("HID function created. Handle: %" PRIun "\n", fun->handle); 216 217 return EOK; 218 } 219 220 /*----------------------------------------------------------------------------*/ 221 222 int usb_generic_hid_init(usb_hid_dev_t *hid_dev, void **data) 223 { 224 if (hid_dev == NULL) { 225 return EINVAL; 226 } 227 228 return usb_generic_hid_create_function(hid_dev); 233 *data = fun; 234 235 return EOK; 229 236 } 230 237 -
uspace/drv/bus/usb/usbhid/generic/hiddev.h
raf8c9b54 rc5b6db53 50 50 int usb_generic_hid_init(struct usb_hid_dev *hid_dev, void **data); 51 51 52 void usb_generic_hid_deinit(struct usb_hid_dev *hid_dev, void *data); 53 52 54 bool usb_generic_hid_polling_callback(struct usb_hid_dev *hid_dev, void *data); 53 55 -
uspace/drv/bus/usb/usbhid/usbhid.c
raf8c9b54 rc5b6db53 155 155 156 156 // set the deinit callback 157 hid_dev->subdrivers[hid_dev->subdriver_count].deinit = NULL; 157 hid_dev->subdrivers[hid_dev->subdriver_count].deinit = 158 usb_generic_hid_deinit; 158 159 159 160 // set subdriver count … … 270 271 hid_dev->subdrivers[count].init = usb_generic_hid_init; 271 272 hid_dev->subdrivers[count].poll = usb_generic_hid_polling_callback; 272 hid_dev->subdrivers[count].deinit = NULL;273 hid_dev->subdrivers[count].deinit = usb_generic_hid_deinit; 273 274 hid_dev->subdrivers[count].poll_end = NULL; 274 275
Note:
See TracChangeset
for help on using the changeset viewer.