lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 12 Mar 2011 22:32:19 +0000
From:	Andy Green <andy@...mcat.com>
To:	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Cc:	patches@...aro.org, Andy Green <andy.green@...aro.org>
Subject: [RFC PATCH 2/4] PLATFORM: Introduce registration function for async
 platform data maps

This adds a small platform API that lets a board definition file
register a mapping structure for asynchronously probed devices so
platform_data can be attached to them at probe time.

Signed-off-by: Andy Green <andy.green@...aro.org>
---

 drivers/base/platform.c         |   21 +++++++++++++++++++++
 include/linux/platform_device.h |    3 +++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index f051cff..180e372 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -31,6 +31,12 @@ struct device platform_bus = {
 };
 EXPORT_SYMBOL_GPL(platform_bus);
 
+struct platform_async_platform_data *platform_async_platform_data_map;
+EXPORT_SYMBOL_GPL(platform_async_platform_data_map);
+
+int platform_async_platform_data_count;
+EXPORT_SYMBOL_GPL(platform_async_platform_data_count);
+
 /**
  * platform_get_resource - get a resource for a device
  * @dev: platform device
@@ -1332,3 +1338,18 @@ void __init early_platform_cleanup(void)
 	}
 }
 
+/**
+ * platform_async_platform_data_register - register an array of async-
+ *				probed bus / device names mapping to
+ *				plaform_data for that device.
+ * @map:	the array of devname vs platform_data mapping structs
+ * @count:	the count of structs in the @map array
+ */
+
+void platform_async_platform_data_register(
+			    struct platform_async_platform_data *map, int count)
+{
+	platform_async_platform_data_map = map;
+	platform_async_platform_data_count = count;
+}
+EXPORT_SYMBOL_GPL(platform_async_platform_data_register);
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index d8c0ba9..19ea497 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -210,4 +210,7 @@ struct platform_async_platform_data {
 	void *platform_data;
 };
 
+extern void platform_async_platform_data_register(
+			   struct platform_async_platform_data *map, int count);
+
 #endif /* _PLATFORM_DEVICE_H_ */

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ