Changeset 400735e in mainline for uspace/drv/uhci-hcd/uhci.c


Ignore:
Timestamp:
2011-05-28T14:30:58Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3fb5a3e
Parents:
e8f826b (diff), 48141f0 (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 development/ changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/uhci.c

    re8f826b r400735e  
    6161} uhci_t;
    6262
    63 static inline uhci_t * dev_to_uhci(ddf_dev_t *dev)
     63static inline uhci_t * dev_to_uhci(const ddf_dev_t *dev)
    6464{
    6565        assert(dev);
     
    7777{
    7878        assert(dev);
    79         hc_t *hc = &((uhci_t*)dev->driver_data)->hc;
    80         uint16_t status = IPC_GET_ARG1(*call);
     79        uhci_t *uhci = dev_to_uhci(dev);
     80        hc_t *hc = &uhci->hc;
     81        const uint16_t status = IPC_GET_ARG1(*call);
    8182        assert(hc);
    8283        hc_interrupt(hc, status);
    8384}
     85/*----------------------------------------------------------------------------*/
     86/** Operations supported by the HC driver */
     87static ddf_dev_ops_t hc_ops = {
     88        .interfaces[USBHC_DEV_IFACE] = &hc_iface, /* see iface.h/c */
     89};
    8490/*----------------------------------------------------------------------------*/
    8591/** Get address of the device identified by handle.
     
    113119 * @return Error code.
    114120 */
    115 static int usb_iface_get_hc_handle(
    116     ddf_fun_t *fun, devman_handle_t *handle)
     121static int usb_iface_get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle)
    117122{
    118123        assert(fun);
     
    131136};
    132137/*----------------------------------------------------------------------------*/
    133 /** Operations supported by the HC driver */
    134 static ddf_dev_ops_t hc_ops = {
    135         .interfaces[USBHC_DEV_IFACE] = &hc_iface, /* see iface.h/c */
    136 };
    137 /*----------------------------------------------------------------------------*/
    138138/** Get root hub hw resources (I/O registers).
    139139 *
     
    144144{
    145145        assert(fun);
    146         return &((rh_t*)fun->driver_data)->resource_list;
     146        rh_t *rh = fun->driver_data;
     147        assert(rh);
     148        return &rh->resource_list;
    147149}
    148150/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.