Thread (73 messages) 73 messages, 6 authors, 2012-05-14
STALE5158d

[PATCH 01/15] i2c/busses: Add Device Tree support to the Nomadik I2C driver

From: arnd@arndb.de (Arnd Bergmann)
Date: 2012-05-04 20:02:20
Also in: linux-i2c

On Friday 04 May 2012, Lee Jones wrote:
+static const struct nmk_i2c_controller *
+nmk_i2c_find_pdata_from_compatible(struct device_node *np)
+{
+       /*
+        * The u8500 is currently our only user. As more SoCs are added,
+        * search for the correct value set using of_machine_is_compatible
+        * and return a 'struct nmk_i2c_controller *' which contains the
+        * correct information for the given SoC, whilst leaving u8500_i2c
+        * as the default/fall-back value set.
+        */
+       return &u8500_i2c;
+}
Why not just put this pointer ...
+static const struct of_device_id nmk_gpio_match[] = {
+       { .compatible = "st,nomadik-i2c", },
+       {}
+};
into the .data field after the .compatible match, and make it more specific
to the soc, i.e.

static const struct of_device_id nmk_gpio_match[] = {
	{ .compatible = "st-ericsson,u8500-i2c", .data = &u8500_i2c },
	{ .compatible = "st,nomadik-i2c", .data = &default_i2c_controller },
};

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help