Thread (8 messages) 8 messages, 5 authors, 2013-08-19

[PATCH RESEND] i2c: move of helpers into the core

From: Thierry Reding <hidden>
Date: 2013-08-19 19:46:11
Also in: linux-acpi, linux-i2c, linux-media, linux-omap, linux-samsung-soc, linux-tegra, linuxppc-dev, lkml

On Mon, Aug 19, 2013 at 07:59:40PM +0200, Wolfram Sang wrote:
[...]
quoted hunk ↗ jump to hunk
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
[...]
+#if IS_ENABLED(CONFIG_OF)
+static void of_i2c_register_devices(struct i2c_adapter *adap)
+{
[...]
+}
[...]
+#endif /* CONFIG_OF */
Isn't this missing the dummy implementation for !OF.
quoted hunk ↗ jump to hunk
 static int i2c_do_add_adapter(struct i2c_driver *driver,
 			      struct i2c_adapter *adap)
 {
@@ -1058,6 +1160,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 
 exit_recovery:
 	/* create pre-declared device nodes */
+	of_i2c_register_devices(adap);
Alternatively you could remove the of_i2c_register_devices() from the
"#ifdef CONFIG_OF" block so that it will always be compiled. You could
turn the above into

	if (IS_ENABLED(CONFIG_OF))
		of_i2c_register_devices(adap);

and let the compiler throw the static function away if it sees that the
condition is always false.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130819/39b2197d/attachment.sig>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help