Thread (3 messages) flat view 3 messages, 2 authors, 2012-10-01
STALE5102d

[RFC PATCH 2/6] Introduce ACPI style match in platform_match

From: Zhang Rui <hidden>
Date: 2012-09-28 07:38:38
Also in: linux-acpi, linux-i2c, lkml
Subsystem: driver core, kobjects, debugfs and sysfs, the rest · Maintainers: Greg Kroah-Hartman, "Rafael J. Wysocki", Danilo Krummrich, Linus Torvalds

From 5d7ecd12c2994b8c5905d52718c2870c3b62746e Mon Sep 17 00:00:00 2001
From: Zhang Rui <redacted>
Date: Fri, 28 Sep 2012 14:51:03 +0800
Subject: [RFC PATCH 2/6] Introduce ACPI style match in platform_match

Signed-off-by: Zhang Rui <redacted>
---
 drivers/base/platform.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index a1a7225..90e64c6f 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -20,6 +20,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/pm_runtime.h>
+#include <linux/acpi.h>
 
 #include "base.h"
 
@@ -635,6 +636,13 @@ static const struct platform_device_id *platform_match_id(
 			struct platform_device *pdev)
 {
 	while (id->name[0]) {
+#ifdef CONFIG_ACPI
+		/* attempt ACPI style match */
+		if (acpi_match_device_id(&pdev->dev, id->name) == 0) {
+			pdev->id_entry = id;
+			return id;
+		}
+#endif
 		if (strcmp(pdev->name, id->name) == 0) {
 			pdev->id_entry = id;
 			return id;
-- 
1.7.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help