[PATCH 5.11 303/775] Input: da7280 - protect OF match table with CONFIG_OF

From
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date
2021-03-02 03:08:23
Also in
lkml
Reply to
Greg Kroah-Hartman, 2021-03-02
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

[ Upstream commit 6d2ad82fece2f5adcafe77252614fcf7211dec28 ]

The OF match table is only used when OF is enabled.

Fixes: cd3f609823a5 ("Input: new da7280 haptic driver")
Reported-by: kernel test robot <redacted>
Acked-by: Roy Im <redacted>
Link: https://lore.kernel.org/r/X9xRLVPt9eBi0CT6@google.com (local)
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/input/misc/da7280.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c
index 2f698a8c1d650..b08610d6e575e 100644
--- a/drivers/input/misc/da7280.c
+++ b/drivers/input/misc/da7280.c
@@ -1300,11 +1300,13 @@ static int __maybe_unused da7280_resume(struct device *dev)
 	return retval;
 }
 
+#ifdef CONFIG_OF
 static const struct of_device_id da7280_of_match[] = {
 	{ .compatible = "dlg,da7280", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, da7280_of_match);
+#endif
 
 static const struct i2c_device_id da7280_i2c_id[] = {
 	{ "da7280", },
-- 
2.27.0


Thread (776 messages) 776 messages, 1 author, last reply 2021-03-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help