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


Ignore:
Timestamp:
2012-12-26T19:02:51Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
34289ea
Parents:
d8cdf39e
Message:

libusbdev: Drop support for custom function data and ops.

Unused and it will go away soon anyway.

File:
1 edited

Legend:

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

    rd8cdf39e rdb8b7ca  
    3333 * Functions for recognition of attached devices.
    3434 */
    35 
    36 /** XXX Fix this */
    37 #define _DDF_DATA_IMPLANT
    3835
    3936#include <sys/types.h>
     
    318315 */
    319316int usb_device_register_child_in_devman(usb_pipe_t *ctrl_pipe,
    320     ddf_dev_t *parent, ddf_dev_ops_t *dev_ops, void *dev_data,
    321     ddf_fun_t **child_fun)
     317    ddf_dev_t *parent, ddf_fun_t **child_fun)
    322318{
    323319        if (child_fun == NULL || ctrl_pipe == NULL)
    324320                return EINVAL;
    325        
    326         if (!dev_ops && dev_data) {
    327                 usb_log_warning("Using standard fun ops with arbitrary "
    328                     "driver data. This does not have to work.\n");
    329         }
    330321       
    331322        /** Index to append after device name for uniqueness. */
     
    354345        }
    355346       
    356         if (dev_ops != NULL)
    357                 ddf_fun_set_ops(child, dev_ops);
    358         else
    359                 ddf_fun_set_ops(child, &child_ops);
    360        
    361         ddf_fun_data_implant(child, dev_data);
    362        
     347        ddf_fun_set_ops(child, &child_ops);
    363348        /*
    364349         * Store the attached device in fun
    365350         * driver data if there is no other data
    366351         */
    367         if (!dev_data) {
    368                 usb_hub_attached_device_t *new_device = ddf_fun_data_alloc(
    369                     child, sizeof(usb_hub_attached_device_t));
    370                 if (!new_device) {
    371                         rc = ENOMEM;
    372                         goto failure;
    373                 }
    374                
    375                 new_device->address = ctrl_pipe->wire->address;
    376                 new_device->fun = child;
    377         }
     352        usb_hub_attached_device_t *new_device = ddf_fun_data_alloc(
     353            child, sizeof(usb_hub_attached_device_t));
     354        if (!new_device) {
     355                rc = ENOMEM;
     356                goto failure;
     357        }
     358       
     359        new_device->address = ctrl_pipe->wire->address;
     360        new_device->fun = child;
    378361       
    379362        match_id_list_t match_ids;
Note: See TracChangeset for help on using the changeset viewer.