Changeset ffa96c2 in mainline for uspace/drv/bus


Ignore:
Timestamp:
2014-07-25T17:52:58Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a861ccb3
Parents:
b5111c46
Message:

Convert libusbdev away from DDF_DATA_IMPLANT.

Location:
uspace/drv/bus/usb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhcirh/port.c

    rb5111c46 rffa96c2  
    269269        int ret, count = MAX_ERROR_COUNT;
    270270        do {
    271                 ret = usb_hc_new_device_wrapper(port->rh, &port->hc_connection,
     271                port->attached_device.fun = ddf_fun_create(port->rh, fun_inner,
     272                    NULL);
     273                if (port->attached_device.fun == NULL) {
     274                        ret = ENOMEM;
     275                        continue;
     276                }
     277
     278                ret = usb_hc_new_device_wrapper(port->rh,
     279                    port->attached_device.fun,
     280                    &port->hc_connection,
    272281                    speed, uhci_port_reset_enable, port,
    273                     &port->attached_device.address, NULL, NULL,
    274                     &port->attached_device.fun);
     282                    &port->attached_device.address, NULL);
     283
     284                if (ret != EOK) {
     285                        ddf_fun_destroy(port->attached_device.fun);
     286                        port->attached_device.fun = NULL;
     287                }
     288
    275289        } while (ret != EOK && count-- > 0);
    276290
  • uspace/drv/bus/usb/usbhub/port.c

    rb5111c46 rffa96c2  
    424424        ddf_fun_t *child_fun;
    425425
     426        child_fun = ddf_fun_create(data->hub->usb_device->ddf_dev,
     427            fun_inner, NULL);
     428        if (child_fun == NULL)
     429                return ENOMEM;
     430
    426431        const int rc = usb_hc_new_device_wrapper(data->hub->usb_device->ddf_dev,
    427             &data->hub->usb_device->hc_conn, data->speed, enable_port_callback,
    428             data->port, &new_address, NULL, NULL, &child_fun);
     432            child_fun, &data->hub->usb_device->hc_conn, data->speed,
     433            enable_port_callback, data->port, &new_address, NULL);
    429434
    430435        if (rc == EOK) {
     
    440445                    ddf_fun_get_handle(child_fun));
    441446        } else {
     447                ddf_fun_destroy(child_fun);
    442448                usb_log_error("Failed registering device on port %zu: %s.\n",
    443449                    data->port->port_number, str_error(rc));
  • uspace/drv/bus/usb/vhc/hub.c

    rb5111c46 rffa96c2  
    114114
    115115        ddf_fun_t *hub_dev;
    116         rc = usb_hc_new_device_wrapper(ddf_fun_get_dev(hc_dev), &hc_conn, USB_SPEED_FULL,
    117             pretend_port_rest, NULL, NULL, &rh_ops, hc_dev, &hub_dev);
     116
     117        hub_dev = ddf_fun_create(ddf_fun_get_dev(hc_dev), fun_inner, NULL);
     118        if (hub_dev == NULL) {
     119                rc = ENOMEM;
     120                usb_log_fatal("Failed to create root hub: %s.\n",
     121                    str_error(rc));
     122                return rc;
     123        }
     124
     125        rc = usb_hc_new_device_wrapper(ddf_fun_get_dev(hc_dev), hub_dev,
     126            &hc_conn, USB_SPEED_FULL, pretend_port_rest, NULL, NULL, &rh_ops);
    118127        if (rc != EOK) {
    119128                usb_log_fatal("Failed to create root hub: %s.\n",
    120129                    str_error(rc));
     130                ddf_fun_destroy(hub_dev);
    121131        }
    122132
Note: See TracChangeset for help on using the changeset viewer.