kernel: Compare pointers before strings when getting device binding

Most calls to device_get_binding() will pass named constants generated
by Kconfig; these constants will all point to the same place, so
compare the pointer before attempting to match the whole string.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
diff --git a/kernel/device.c b/kernel/device.c
index 86fcb6b..bb892fb 100644
--- a/kernel/device.c
+++ b/kernel/device.c
@@ -61,7 +61,15 @@
 	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;
 		}
 	}