Changeset f55b12b in mainline for uspace/lib/usb/src/hc.c


Ignore:
Timestamp:
2011-08-18T18:41:03Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0cc32f2, a92cf94f, cf22ada
Parents:
3190e88 (diff), 763e0cd (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 mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hc.c

    r3190e88 rf55b12b  
    201201/** Get host controller handle by its class index.
    202202 *
    203  * @param class_index Class index for the host controller.
     203 * @param sid Service ID of the HC function.
    204204 * @param hc_handle Where to store the HC handle
    205205 *      (can be NULL for existence test only).
    206206 * @return Error code.
    207207 */
    208 int usb_ddf_get_hc_handle_by_class(size_t class_index,
    209     devman_handle_t *hc_handle)
    210 {
    211         char *class_index_str;
    212         devman_handle_t hc_handle_tmp;
     208int usb_ddf_get_hc_handle_by_sid(service_id_t sid, devman_handle_t *hc_handle)
     209{
     210        devman_handle_t handle;
    213211        int rc;
    214 
    215         rc = asprintf(&class_index_str, "%zu", class_index);
    216         if (rc < 0) {
    217                 return ENOMEM;
    218         }
    219         rc = devman_device_get_handle_by_class("usbhc", class_index_str,
    220             &hc_handle_tmp, 0);
    221         free(class_index_str);
    222         if (rc != EOK) {
    223                 return rc;
    224         }
    225 
    226         if (hc_handle != NULL) {
    227                 *hc_handle = hc_handle_tmp;
    228         }
    229 
    230         return EOK;
     212       
     213        rc = devman_fun_sid_to_handle(sid, &handle);
     214        if (hc_handle != NULL)
     215                *hc_handle = handle;
     216       
     217        return rc;
    231218}
    232219
Note: See TracChangeset for help on using the changeset viewer.