diff options
Diffstat (limited to 'firmware/usbstack/core/core.c')
-rw-r--r-- | firmware/usbstack/core/core.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/firmware/usbstack/core/core.c b/firmware/usbstack/core/core.c index e201b7547f..2fbec5d571 100644 --- a/firmware/usbstack/core/core.c +++ b/firmware/usbstack/core/core.c | |||
@@ -378,6 +378,8 @@ static void update_driver_names(unsigned char* result) { | |||
378 | 378 | ||
379 | static void bind_device_driver(struct usb_device_driver* driver) { | 379 | static void bind_device_driver(struct usb_device_driver* driver) { |
380 | 380 | ||
381 | int ret = 0; | ||
382 | |||
381 | /* look if there is an old driver */ | 383 | /* look if there is an old driver */ |
382 | if (usbcore.active_controller->device_driver != NULL) { | 384 | if (usbcore.active_controller->device_driver != NULL) { |
383 | usbcore.active_controller->device_driver->unbind(); | 385 | usbcore.active_controller->device_driver->unbind(); |
@@ -387,7 +389,11 @@ static void bind_device_driver(struct usb_device_driver* driver) { | |||
387 | usbcore.active_controller->device_driver = driver; | 389 | usbcore.active_controller->device_driver = driver; |
388 | 390 | ||
389 | /* init dirver */ | 391 | /* init dirver */ |
390 | driver->bind(usbcore.active_controller->controller_ops); | 392 | ret = driver->bind(usbcore.active_controller->controller_ops); |
391 | } | ||
392 | |||
393 | 393 | ||
394 | if (ret != 0) { | ||
395 | logf("binding of %s failed", driver->name); | ||
396 | usbcore.active_controller->device_driver = NULL; | ||
397 | usbcore.device_driver = NULL; | ||
398 | } | ||
399 | } | ||