Changeset a8ac368 in mainline for uspace/drv/usbmid/main.c


Ignore:
Timestamp:
2011-03-29T20:08:53Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
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.
Message:

development changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbmid/main.c

    r0d92638 ra8ac368  
    4949 * @return Error code.
    5050 */
    51 static int usbmid_add_device(ddf_dev_t *gen_dev)
     51static int usbmid_add_device(usb_device_t *dev)
    5252{
    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);
    6054
    6155        int rc;
     
    6559                usb_log_error("Failed to start session on control pipe: %s.\n",
    6660                    str_error(rc));
    67                 goto error_leave;
     61                return rc;
    6862        }
    6963
     
    7771
    7872        if (!accept) {
    79                 rc = ENOTSUP;
    80                 goto error_leave;
     73                return ENOTSUP;
    8174        }
    8275
    83         gen_dev->driver_data = dev;
    84 
    8576        return EOK;
    86 
    87 
    88 error_leave:
    89         free(dev);
    90         return rc;
    9177}
    9278
    9379/** USB MID driver ops. */
    94 static driver_ops_t mid_driver_ops = {
     80static usb_driver_ops_t mid_driver_ops = {
    9581        .add_device = usbmid_add_device,
    9682};
    9783
    9884/** USB MID driver. */
    99 static driver_t mid_driver = {
     85static usb_driver_t mid_driver = {
    10086        .name = NAME,
    101         .driver_ops = &mid_driver_ops
     87        .ops = &mid_driver_ops,
     88        .endpoints = NULL
    10289};
    10390
     
    10794
    10895        usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME);
    109         return ddf_driver_main(&mid_driver);
     96
     97        return usb_driver_main(&mid_driver);
    11098}
    11199
Note: See TracChangeset for help on using the changeset viewer.