Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 26f6094 in mainline for uspace/drv/usbhid/main.c


Ignore:
Timestamp:
2011-05-06T09:25:44Z (11 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master
Children:
d0c060b
Parents:
9e929a0 (diff), 310c4df (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 with usb/development

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/main.c

    r9e929a0 r26f6094  
    9999        usb_log_debug("USB/HID device structure initialized.\n");
    100100       
    101         /* Create the function exposed under /dev/devices. */
    102         ddf_fun_t *hid_fun = ddf_fun_create(dev->ddf_dev, fun_exposed,
    103             usb_hid_get_function_name(hid_dev));
    104         if (hid_fun == NULL) {
    105                 usb_log_error("Could not create DDF function node.\n");
    106                 usb_hid_free(&hid_dev);
    107                 return ENOMEM;
    108         }
    109        
    110         /*
    111          * Store the initialized HID device and HID ops
    112          * to the DDF function.
    113          */
    114         hid_fun->ops = &hid_dev->ops;
    115         hid_fun->driver_data = hid_dev;   // TODO: maybe change to hid_dev->data
    116        
    117101        /*
    118102         * 1) subdriver vytvori vlastnu ddf_fun, vlastne ddf_dev_ops, ktore da
     
    125109         *    pouzit usb/classes/hid/iface.h - prvy int je telefon
    126110         */
    127 
    128         rc = ddf_fun_bind(hid_fun);
    129         if (rc != EOK) {
    130                 usb_log_error("Could not bind DDF function: %s.\n",
    131                     str_error(rc));
    132                 // TODO: Can / should I destroy the DDF function?
    133                 ddf_fun_destroy(hid_fun);
    134                 usb_hid_free(&hid_dev);
    135                 return rc;
    136         }
    137        
    138         rc = ddf_fun_add_to_class(hid_fun, usb_hid_get_class_name(hid_dev));
    139         if (rc != EOK) {
    140                 usb_log_error(
    141                     "Could not add DDF function to class 'hid': %s.\n",
    142                     str_error(rc));
    143                 // TODO: Can / should I destroy the DDF function?
    144                 ddf_fun_destroy(hid_fun);
    145                 usb_hid_free(&hid_dev);
    146                 return rc;
    147         }
    148111       
    149112        /* Start automated polling function.
     
    239202        printf(NAME ": HelenOS USB HID driver.\n");
    240203
    241         usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
     204        //usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
    242205
    243206        return usb_driver_main(&usb_hid_driver);
Note: See TracChangeset for help on using the changeset viewer.