summaryrefslogtreecommitdiff
path: root/firmware/usbstack/core
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/usbstack/core')
-rw-r--r--firmware/usbstack/core/core.c12
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
379static void bind_device_driver(struct usb_device_driver* driver) { 379static 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}