Changeset a6c4597 in mainline
- Timestamp:
- 2018-01-11T04:12:06Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bad4a05
- Parents:
- f82c4822
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-10 22:26:56)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-11 04:12:06)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/bus.c
rf82c4822 ra6c4597 199 199 ep->max_transfer_size); 200 200 201 fibril_mutex_lock(& bus->guard);201 fibril_mutex_lock(&device->guard); 202 202 if (!device->online && ep->endpoint != 0) { 203 203 err = EAGAIN; … … 209 209 device->endpoints[ep->endpoint] = ep; 210 210 } 211 fibril_mutex_unlock(& bus->guard);211 fibril_mutex_unlock(&device->guard); 212 212 if (err) { 213 213 endpoint_del_ref(ep); … … 231 231 assert(device); 232 232 233 bus_t *bus = device->bus; 234 235 fibril_mutex_lock(&bus->guard); 233 fibril_mutex_lock(&device->guard); 236 234 endpoint_t *ep = device->endpoints[endpoint]; 237 235 if (ep) { … … 239 237 endpoint_add_ref(ep); 240 238 } 241 fibril_mutex_unlock(& bus->guard);239 fibril_mutex_unlock(&device->guard); 242 240 return ep; 243 241 } … … 251 249 assert(ep->device); 252 250 253 bus_t *bus = endpoint_get_bus(ep); 251 device_t *device = ep->device; 252 if (!device) 253 return ENOENT; 254 255 bus_t *bus = device->bus; 254 256 255 257 const bus_ops_t *ops = BUS_OPS_LOOKUP(bus->ops, endpoint_unregister); … … 258 260 259 261 usb_log_debug("Unregister endpoint %d:%d %s-%s %zuB.\n", 260 ep->device->address, ep->endpoint,262 device->address, ep->endpoint, 261 263 usb_str_transfer_type(ep->transfer_type), 262 264 usb_str_direction(ep->direction), 263 265 ep->max_transfer_size); 264 266 265 fibril_mutex_lock(& bus->guard);267 fibril_mutex_lock(&device->guard); 266 268 const int r = ops->endpoint_unregister(ep); 267 269 if (!r) 268 ep->device->endpoints[ep->endpoint] = NULL;269 fibril_mutex_unlock(& bus->guard);270 device->endpoints[ep->endpoint] = NULL; 271 fibril_mutex_unlock(&device->guard); 270 272 271 273 if (r)
Note:
See TracChangeset
for help on using the changeset viewer.