Changeset 52c4264 in mainline for uspace/lib/usbdev/src/recognise.c


Ignore:
Timestamp:
2012-08-17T12:23:52Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
267f235
Parents:
ae2c925 (diff), ad78054 (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/usbdev/src/recognise.c

    rae2c925 r52c4264  
    3333 * Functions for recognition of attached devices.
    3434 */
     35
     36/** XXX Fix this */
     37#define _DDF_DATA_IMPLANT
    3538
    3639#include <sys/types.h>
     
    352355       
    353356        if (dev_ops != NULL)
    354                 child->ops = dev_ops;
     357                ddf_fun_set_ops(child, dev_ops);
    355358        else
    356                 child->ops = &child_ops;
    357        
    358         child->driver_data = dev_data;
     359                ddf_fun_set_ops(child, &child_ops);
     360       
     361        ddf_fun_data_implant(child, dev_data);
     362       
    359363        /*
    360364         * Store the attached device in fun
     
    373377        }
    374378       
    375         rc = usb_device_create_match_ids(ctrl_pipe, &child->match_ids);
     379        match_id_list_t match_ids;
     380        init_match_ids(&match_ids);
     381        rc = usb_device_create_match_ids(ctrl_pipe, &match_ids);
    376382        if (rc != EOK)
    377383                goto failure;
     384       
     385        list_foreach(match_ids.ids, id_link) {
     386                match_id_t *match_id = list_get_instance(id_link, match_id_t, link);
     387                rc = ddf_fun_add_match_id(child, match_id->id, match_id->score);
     388                if (rc != EOK) {
     389                        clean_match_ids(&match_ids);
     390                        goto failure;
     391                }
     392        }
     393       
     394        clean_match_ids(&match_ids);
    378395       
    379396        rc = ddf_fun_bind(child);
     
    386403failure:
    387404        if (child != NULL) {
    388                 /* We know nothing about the data if it came from outside. */
    389                 if (dev_data)
    390                         child->driver_data = NULL;
    391                
    392405                /* This takes care of match_id deallocation as well. */
    393406                ddf_fun_destroy(child);
Note: See TracChangeset for help on using the changeset viewer.