Changeset 20a3465 in mainline for uspace/drv/bus/usb/usbflbk/main.c


Ignore:
Timestamp:
2011-10-30T19:50:54Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3ce78580, 48902fa
Parents:
4c3ad56 (diff), 45bf63c (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/drv/bus/usb/usbflbk/main.c

    r4c3ad56 r20a3465  
    6464        }
    6565
     66        dev->driver_data = ctl_fun;
     67
    6668        usb_log_info("Pretending to control %s `%s'" \
    6769            " (node `%s', handle %" PRIun ").\n",
     
    7274}
    7375
     76/** Callback when new device is about to be removed.
     77 *
     78 * @param dev Representation of a generic DDF device.
     79 * @return Error code.
     80 */
     81static int usbfallback_device_remove(usb_device_t *dev)
     82{
     83        return EOK;
     84}
     85
     86/** Callback when new device is removed and recognized as gone by DDF.
     87 *
     88 * @param dev Representation of a generic DDF device.
     89 * @return Error code.
     90 */
     91static int usbfallback_device_gone(usb_device_t *dev)
     92{
     93        assert(dev);
     94        ddf_fun_t *ctl_fun = dev->driver_data;
     95        const int ret = ddf_fun_unbind(ctl_fun);
     96        if (ret != EOK) {
     97                usb_log_error("Failed to unbind %s.\n", ctl_fun->name);
     98                return ret;
     99        }
     100        ddf_fun_destroy(ctl_fun);
     101        dev->driver_data = NULL;
     102
     103        return EOK;
     104}
     105
    74106/** USB fallback driver ops. */
    75 static usb_driver_ops_t usbfallback_driver_ops = {
     107static const usb_driver_ops_t usbfallback_driver_ops = {
    76108        .device_add = usbfallback_device_add,
     109        .device_rem = usbfallback_device_remove,
     110        .device_gone = usbfallback_device_gone,
    77111};
    78112
    79113/** USB fallback driver. */
    80 static usb_driver_t usbfallback_driver = {
     114static const usb_driver_t usbfallback_driver = {
    81115        .name = NAME,
    82116        .ops = &usbfallback_driver_ops,
Note: See TracChangeset for help on using the changeset viewer.