Changeset 98604cc in mainline


Ignore:
Timestamp:
2011-10-14T16:22:07Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
68dbe3e
Parents:
f2964e45
Message:

usbhid: Implement device_gone.

Location:
uspace/drv/bus/usb/usbhid
Files:
2 edited

Legend:

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

    rf2964e45 r98604cc  
    9595                usb_hid_destroy(hid_dev);
    9696                return rc;
    97         }       
     97        }
    9898
    9999        usb_log_debug("USB/HID device structure initialized.\n");
     
    130130                usb_log_error("Failed to start polling fibril for `%s'.\n",
    131131                    dev->ddf_dev->name);
     132                usb_hid_destroy(hid_dev);
    132133                return rc;
    133134        }
     135        dev->driver_data = hid_dev;
    134136
    135137        /*
     
    182184/*----------------------------------------------------------------------------*/
    183185
    184 /* Currently, the framework supports only device adding. Once the framework
    185  * supports unplug, more callbacks will be added. */
     186/**
     187 * Callback for removing a device from the driver.
     188 *
     189 * @param dev Structure representing the device.
     190 *
     191 * @retval EOK if successful.
     192 * @retval EREFUSED if the device is not supported.
     193 */
     194static int usb_hid_device_gone(usb_device_t *dev)
     195{
     196        usb_hid_dev_t *hid_dev = dev->driver_data;
     197        usb_hid_destroy(hid_dev);
     198        return EOK;
     199}
     200
     201/** USB generic driver callbacks */
    186202static usb_driver_ops_t usb_hid_driver_ops = {
    187         .device_add = usb_hid_device_add,
     203        .device_add = usb_hid_device_add,
     204        .device_gone = usb_hid_device_gone,
    188205};
    189206
    190207
    191 /* The driver itself. */
     208/** The driver itself. */
    192209static usb_driver_t usb_hid_driver = {
    193210        .name = NAME,
  • uspace/drv/bus/usb/usbhid/usbhid.c

    rf2964e45 r98604cc  
    630630        }
    631631
    632         usb_hid_destroy(hid_dev);
     632//      usb_hid_destroy(hid_dev);
    633633}
    634634
Note: See TracChangeset for help on using the changeset viewer.