Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/recognise.c

    r56fd7cf r77ad86c  
    3333 * Functions for recognition of attached devices.
    3434 */
    35 
    36 /** XXX Fix this */
    37 #define _DDF_DATA_IMPLANT
    3835
    3936#include <sys/types.h>
     
    355352       
    356353        if (dev_ops != NULL)
    357                 ddf_fun_set_ops(child, dev_ops);
     354                child->ops = dev_ops;
    358355        else
    359                 ddf_fun_set_ops(child, &child_ops);
    360        
    361         ddf_fun_data_implant(child, dev_data);
    362        
     356                child->ops = &child_ops;
     357       
     358        child->driver_data = dev_data;
    363359        /*
    364360         * Store the attached device in fun
     
    377373        }
    378374       
    379         match_id_list_t match_ids;
    380         init_match_ids(&match_ids);
    381         rc = usb_device_create_match_ids(ctrl_pipe, &match_ids);
     375        rc = usb_device_create_match_ids(ctrl_pipe, &child->match_ids);
    382376        if (rc != EOK)
    383377                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);
    395378       
    396379        rc = ddf_fun_bind(child);
     
    403386failure:
    404387        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               
    405392                /* This takes care of match_id deallocation as well. */
    406393                ddf_fun_destroy(child);
Note: See TracChangeset for help on using the changeset viewer.