Changeset 1d5a540 in mainline for uspace/drv/bus/usb/usbmid/usbmid.c


Ignore:
Timestamp:
2012-08-17T11:52:20Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
034c4202
Parents:
8312577 (diff), 56fd7cf (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:

Merge DDF interface tightening.

File:
1 edited

Legend:

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

    r8312577 r1d5a540  
    3030 * @{
    3131 */
     32
     33/* XXX Fix this */
     34#define _DDF_DATA_IMPLANT
     35
    3236/**
    3337 * @file
     
    4751static int usb_iface_get_interface_impl(ddf_fun_t *fun, int *iface_no)
    4852{
    49         assert(fun);
    50 
    51         usbmid_interface_t *iface = fun->driver_data;
     53        usbmid_interface_t *iface = ddf_fun_data_get(fun);
    5254        assert(iface);
    5355
     
    123125        }
    124126
     127        match_id_list_t match_ids;
     128        init_match_ids(&match_ids);
     129
    125130        rc = usb_device_create_match_ids_from_interface(device_descriptor,
    126             interface_descriptor, &child->match_ids);
     131            interface_descriptor, &match_ids);
    127132        if (rc != EOK) {
    128133                ddf_fun_destroy(child);
    129134                return rc;
    130135        }
     136
     137        list_foreach(match_ids.ids, link) {
     138                match_id_t *match_id = list_get_instance(link, match_id_t, link);
     139                rc = ddf_fun_add_match_id(child, match_id->id, match_id->score);
     140                if (rc != EOK) {
     141                        clean_match_ids(&match_ids);
     142                        ddf_fun_destroy(child);
     143                        return rc;
     144                }
     145        }
     146        clean_match_ids(&match_ids);
    131147
    132148        rc = ddf_fun_bind(child);
     
    138154
    139155        iface->fun = child;
    140         child->driver_data = iface;
    141         child->ops = &child_device_ops;
     156        ddf_fun_data_implant(child, iface);
     157        ddf_fun_set_ops(child, &child_device_ops);
    142158
    143159        return EOK;
Note: See TracChangeset for help on using the changeset viewer.