Allocate driver specific data. * @param usb_dev usb_device structure. * @param size requested data size. * @return Pointer to the newly allocated space, NULL on failure. */
| 615 | * @return Pointer to the newly allocated space, NULL on failure. |
| 616 | */ |
| 617 | void *usb_device_data_alloc(usb_device_t *usb_dev, size_t size) |
| 618 | { |
| 619 | assert(usb_dev); |
| 620 | assert(usb_dev->driver_data == NULL); |
| 621 | return usb_dev->driver_data = calloc(1, size); |
| 622 | |
| 623 | } |
| 624 | |
| 625 | void *usb_device_data_get(usb_device_t *usb_dev) |
| 626 | { |
no test coverage detected