lkml.org 
[lkml]   [2014]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/10] ACPI / scan: .match() callback for ACPI scan handlers
Date
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Introduce a .match() callback for ACPI scan handlers to allow them to
use more elaborate matching algorithms if necessary. That is needed
for the upcoming PNP scan handler in particular.

This change is based on a Zhang Rui's prototype.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

---
drivers/acpi/scan.c | 17 +++++++++++------
drivers/acpi/scan.c | 3 +++
include/acpi/acpi_bus.h | 1 +
2 files changed, 4 insertions(+)

Index: linux-pm/drivers/acpi/scan.c
===================================================================
--- linux-pm.orig/drivers/acpi/scan.c
+++ linux-pm/drivers/acpi/scan.c
@@ -1977,6 +1977,9 @@ static bool acpi_scan_handler_matching(s
{
const struct acpi_device_id *devid;

+ if (handler->match)
+ return handler->match(idstr, matchid);
+
for (devid = handler->ids; devid->id[0]; devid++)
if (!strcmp((char *)devid->id, idstr)) {
if (matchid)
Index: linux-pm/include/acpi/acpi_bus.h
===================================================================
--- linux-pm.orig/include/acpi/acpi_bus.h
+++ linux-pm/include/acpi/acpi_bus.h
@@ -131,6 +131,7 @@ static inline struct acpi_hotplug_profil
struct acpi_scan_handler {
const struct acpi_device_id *ids;
struct list_head list_node;
+ bool (*match)(char *idstr, const struct acpi_device_id **matchid);
int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id);
void (*detach)(struct acpi_device *dev);
void (*bind)(struct device *phys_dev);


\
 
 \ /
  Last update: 2014-05-30 05:01    [W:0.172 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site