Thread (7 messages) 7 messages, 4 authors, 2014-08-08

Re: [PATCH] Adding a support for Skyworks SKY81452

From: Tobias Klauser <tklauser@distanz.ch>
Date: 2014-08-08 07:20:46
Also in: linux-fbdev, lkml

On 2014-08-08 at 09:09:19 +0200, Thierry Reding [off-list ref] wrote:
On Thu, Aug 07, 2014 at 02:34:39PM +0200, Tobias Klauser wrote:
quoted
On 2014-08-07 at 10:05:38 +0200, Gyungoh Yoo [off-list ref] wrote:
[...]
quoted
quoted
+#ifdef CONFIG_OF
+static const struct of_device_id sky81452_of_match[] = {
+	{.compatible = "sky,sky81452",},
+	{ }
+};
+MODULE_DEVICE_TABLE(of, sky81452_of_match);
+#endif
The #ifdefery here is not needed since you use of_match_ptr below, whcih
will expand to NULL of CONFIG_OF is not set.
On the contrary, that's exactly why the #ifdef is needed here. If you
don't guard the OF match table here, then of_match_ptr() evaluating to
NULL will cause the table to become unused and the compiler warning
about it.
Oops, yes of course. Sorry about that and thanks for your correction.

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