Changeset 53a9d02 in mainline for uspace/lib/usbhost/src/bus.c


Ignore:
Timestamp:
2018-01-11T09:17:43Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
30fc56f
Parents:
17783bf
Message:

usb: fix errors introduced by recent changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/bus.c

    r17783bf r53a9d02  
    109109                return ENOTSUP;
    110110
    111         if (dev->online) {
    112                 fibril_mutex_unlock(&dev->guard);
     111        if (dev->online)
    113112                return EINVAL;
    114         }
    115113
    116114        const int r = ops->device_enumerate(dev);
    117         if (!r) {
    118                 dev->online = true;
    119 
     115        if (r)
     116                return r;
     117
     118        dev->online = true;
     119
     120        if (dev->hub) {
    120121                fibril_mutex_lock(&dev->hub->guard);
    121122                list_append(&dev->link, &dev->hub->devices);
     
    123124        }
    124125
    125         return r;
     126        return EOK;
    126127}
    127128
     
    192193
    193194        /* Remove our device from our hub's children. */
    194         fibril_mutex_lock(&dev->hub->guard);
    195         list_remove(&dev->link);
    196         fibril_mutex_unlock(&dev->hub->guard);
     195        if (dev->hub) {
     196                fibril_mutex_lock(&dev->hub->guard);
     197                list_remove(&dev->link);
     198                fibril_mutex_unlock(&dev->hub->guard);
     199        }
    197200
    198201        /*
Note: See TracChangeset for help on using the changeset viewer.