Changeset a8ac368 in mainline for uspace/drv/usbmid/main.c
- Timestamp:
- 2011-03-29T20:08:53Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fc883bb
- Parents:
- 0d92638 (diff), 51e5608 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbmid/main.c
r0d92638 ra8ac368 49 49 * @return Error code. 50 50 */ 51 static int usbmid_add_device( ddf_dev_t *gen_dev)51 static int usbmid_add_device(usb_device_t *dev) 52 52 { 53 usbmid_device_t *dev = usbmid_device_create(gen_dev); 54 if (dev == NULL) { 55 return ENOMEM; 56 } 57 58 usb_log_info("Taking care of new MID: addr %d (HC %zu)\n", 59 dev->wire.address, dev->wire.hc_handle); 53 usb_log_info("Taking care of new MID `%s'.\n", dev->ddf_dev->name); 60 54 61 55 int rc; … … 65 59 usb_log_error("Failed to start session on control pipe: %s.\n", 66 60 str_error(rc)); 67 goto error_leave;61 return rc; 68 62 } 69 63 … … 77 71 78 72 if (!accept) { 79 rc = ENOTSUP; 80 goto error_leave; 73 return ENOTSUP; 81 74 } 82 75 83 gen_dev->driver_data = dev;84 85 76 return EOK; 86 87 88 error_leave:89 free(dev);90 return rc;91 77 } 92 78 93 79 /** USB MID driver ops. */ 94 static driver_ops_t mid_driver_ops = {80 static usb_driver_ops_t mid_driver_ops = { 95 81 .add_device = usbmid_add_device, 96 82 }; 97 83 98 84 /** USB MID driver. */ 99 static driver_t mid_driver = {85 static usb_driver_t mid_driver = { 100 86 .name = NAME, 101 .driver_ops = &mid_driver_ops 87 .ops = &mid_driver_ops, 88 .endpoints = NULL 102 89 }; 103 90 … … 107 94 108 95 usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME); 109 return ddf_driver_main(&mid_driver); 96 97 return usb_driver_main(&mid_driver); 110 98 } 111 99
Note:
See TracChangeset
for help on using the changeset viewer.