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:	Tue, 28 Oct 2008 20:46:15 +0300
From:	Anton Vorontsov <avorontsov@...mvista.com>
To:	Grant Likely <grant.likely@...retlab.ca>,
	David Brownell <david-b@...bell.net>
Cc:	benh@...nel.crashing.org, linux-kernel@...r.kernel.org,
	David Miller <davem@...emloft.net>
Subject: [PATCH 3/6] of/of_i2c: add support for dedicated OF I2C devices

of_i2c will create the OF platform device if it knows that the
device won't work without platform data. The OF platform driver
will fill the platform data and will register real I2C device.

Signed-off-by: Anton Vorontsov <avorontsov@...mvista.com>
---
 drivers/of/of_i2c.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c
index 57de7c5..02aa1d6 100644
--- a/drivers/of/of_i2c.c
+++ b/drivers/of/of_i2c.c
@@ -13,6 +13,7 @@
 
 #include <linux/i2c.h>
 #include <linux/of.h>
+#include <linux/of_platform.h>
 #include <linux/of_i2c.h>
 #include <linux/module.h>
 
@@ -67,6 +68,17 @@ void of_register_i2c_devices(struct i2c_adapter *adap,
 	for_each_child_of_node(adap_node, node) {
 		struct i2c_board_info info = {};
 
+#ifdef CONFIG_PPC
+		/* TODO: of_platform_device_create() for SPARC. */
+		if (of_should_create_pdev(node)) {
+			struct of_device *of_pdev;
+
+			of_pdev = of_platform_device_create(node, NULL,
+							    &adap->dev);
+			WARN_ON(!of_pdev);
+			continue;
+		}
+#endif
 		of_register_i2c_device(adap, &info, node);
 	}
 }
-- 
1.5.6.3

--
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