Changeset 8be7819 in mainline for uspace/drv/bus/usb/usbmid/explore.c


Ignore:
Timestamp:
2011-10-30T19:59:15Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cae002c
Parents:
e462909
Message:

usbmid: Implement dev_remove and some minor refactoring.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbmid/explore.c

    re462909 r8be7819  
    139139        int rc;
    140140
    141         int dev_class = dev->descriptors.device.device_class;
     141        unsigned dev_class = dev->descriptors.device.device_class;
    142142        if (dev_class != USB_CLASS_USE_INTERFACE) {
    143143                usb_log_warning(
    144                     "Device class: %d (%s), but expected class 0.\n",
    145                     dev_class, usb_str_class(dev_class));
     144                    "Device class: %u (%s), but expected class %u.\n",
     145                    dev_class, usb_str_class(dev_class),
     146                    USB_CLASS_USE_INTERFACE);
    146147                usb_log_error("Not multi interface device, refusing.\n");
    147148                return false;
    148149        }
    149150
    150         /* Short cuts to save on typing ;-). */
     151        /* Shortcuts to save on typing ;-). */
    151152        const void *config_descriptor_raw = dev->descriptors.configuration;
    152153        size_t config_descriptor_size = dev->descriptors.configuration_size;
     
    163164        }
    164165
     166        /* Create driver soft-state. */
    165167        usb_mid_t *usb_mid = usb_device_data_alloc(dev, sizeof(usb_mid_t));
    166168        if (!usb_mid) {
     
    169171        }
    170172
    171         /* Create control function */
     173        /* Create control function. */
    172174        usb_mid->ctl_fun = ddf_fun_create(dev->ddf_dev, fun_exposed, "ctl");
    173175        if (usb_mid->ctl_fun == NULL) {
     
    175177                return false;
    176178        }
    177 
    178179        usb_mid->ctl_fun->ops = &mid_device_ops;
    179180
     181        /* Bind control function. */
    180182        rc = ddf_fun_bind(usb_mid->ctl_fun);
    181183        if (rc != EOK) {
     
    192194            &usb_mid->interface_list);
    193195
     196        /* Start child function for every interface. */
    194197        list_foreach(usb_mid->interface_list, link) {
    195                 usbmid_interface_t *iface = list_get_instance(link,
    196                     usbmid_interface_t, link);
     198                usbmid_interface_t *iface = usbmid_interface_from_link(link);
    197199
    198200                usb_log_info("Creating child for interface %d (%s).\n",
    199                     (int) iface->interface_no,
     201                    iface->interface_no,
    200202                    usb_str_class(iface->interface->interface_class));
    201203
Note: See TracChangeset for help on using the changeset viewer.