diff --git a/kernel/device.c b/kernel/device.c index 86fcb6be32b..bb892fbacf0 100644 --- a/kernel/device.c +++ b/kernel/device.c @@ -61,7 +61,15 @@ struct device *device_get_binding(const char *name) struct device *info; for (info = __device_init_start; info != __device_init_end; info++) { - if (info->driver_api && !strcmp(name, info->config->name)) { + if (!info->driver_api) { + continue; + } + + if (name == info->config->name) { + return info; + } + + if (!strcmp(name, info->config->name)) { return info; } }