Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/ohci_endpoint.c

    r620c710 r57e06ef  
    6262}
    6363/*----------------------------------------------------------------------------*/
    64 /** Disposes hcd endpoint structure
    65  *
    66  * @param[in] hcd_ep endpoint structure
    67  */
    68 static void ohci_endpoint_fini(endpoint_t *ep)
    69 {
    70         ohci_endpoint_t *instance = ep->hc_data.data;
    71         hc_dequeue_endpoint(instance->hcd->private_data, ep);
    72         if (instance) {
    73                 free32(instance->ed);
    74                 free32(instance->td);
    75                 free(instance);
    76         }
    77 }
    78 /*----------------------------------------------------------------------------*/
    7964/** Creates new hcd endpoint representation.
    8065 *
    8166 * @param[in] ep USBD endpoint structure
    82  * @return pointer to a new hcd endpoint structure, NULL on failure.
     67 * @return Error code.
    8368 */
    8469int ohci_endpoint_init(hcd_t *hcd, endpoint_t *ep)
     
    10287        }
    10388
    104         ed_init(ohci_ep->ed, ep);
    105         ed_set_td(ohci_ep->ed, ohci_ep->td);
     89        ed_init(ohci_ep->ed, ep, ohci_ep->td);
    10690        endpoint_set_hc_data(
    107             ep, ohci_ep, ohci_endpoint_fini, ohci_ep_toggle_get, ohci_ep_toggle_set);
    108         ohci_ep->hcd = hcd;
     91            ep, ohci_ep, ohci_ep_toggle_get, ohci_ep_toggle_set);
    10992        hc_enqueue_endpoint(hcd->private_data, ep);
    11093        return EOK;
     94}
     95/*----------------------------------------------------------------------------*/
     96/** Disposes hcd endpoint structure
     97 *
     98 * @param[in] hcd driver using this instance.
     99 * @param[in] ep endpoint structure.
     100 */
     101void ohci_endpoint_fini(hcd_t *hcd, endpoint_t *ep)
     102{
     103        assert(hcd);
     104        assert(ep);
     105        ohci_endpoint_t *instance = ohci_endpoint_get(ep);
     106        hc_dequeue_endpoint(hcd->private_data, ep);
     107        if (instance) {
     108                free32(instance->ed);
     109                free32(instance->td);
     110                free(instance);
     111        }
     112        endpoint_clear_hc_data(ep);
    111113}
    112114/**
Note: See TracChangeset for help on using the changeset viewer.