Changeset 9e2132a in mainline for uspace/drv/bus/usb/usbmid/usbmid.c


Ignore:
Timestamp:
2012-12-30T20:14:13Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
17bbb28
Parents:
6df4adc4
Message:

usbmid: Don't use ddf_fun_data_implant.

Remove unused pointer to interface descriptor.

File:
1 edited

Legend:

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

    r6df4adc4 r9e2132a  
    3030 * @{
    3131 */
    32 
    33 /* XXX Fix this */
    34 #define _DDF_DATA_IMPLANT
    3532
    3633/**
     
    8178                return ret;
    8279        }
    83         /* NOTE: usbmid->interface points somewhere, but we did not
    84          * allocate that space, so don't touch */
    8580        ddf_fun_destroy(mid_iface->fun);
    86         /* NOTE: mid_iface is invalid at this point, it was assigned to
    87          * mid_iface->fun->driver_data and freed in ddf_fun_destroy */
    8881        return EOK;
    8982}
     
    9891 */
    9992int usbmid_spawn_interface_child(usb_device_t *parent,
    100     usbmid_interface_t *iface,
     93    usbmid_interface_t **iface_ret,
    10194    const usb_standard_device_descriptor_t *device_descriptor,
    10295    const usb_standard_interface_descriptor_t *interface_descriptor)
     
    145138        }
    146139        clean_match_ids(&match_ids);
     140        ddf_fun_set_ops(child, &child_device_ops);
     141
     142        usbmid_interface_t *iface = ddf_fun_data_alloc(child, sizeof(*iface));
     143
     144        iface->fun = child;
     145        iface->interface_no = interface_descriptor->interface_number;
     146        link_initialize(&iface->link);
    147147
    148148        rc = ddf_fun_bind(child);
     
    152152                return rc;
    153153        }
    154 
    155         iface->fun = child;
    156         ddf_fun_data_implant(child, iface);
    157         ddf_fun_set_ops(child, &child_device_ops);
     154        *iface_ret = iface;
    158155
    159156        return EOK;
Note: See TracChangeset for help on using the changeset viewer.