mtd: docg3: fix 'defined but not used' warning

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Dec 15 19:59:03 PST 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d4efafcc040dcc91b09fd393756e4ee4ad7bf9f2
Commit:     d4efafcc040dcc91b09fd393756e4ee4ad7bf9f2
Parent:     a1ff7d64c5361c15bac653708a679de13506d283
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Wed Oct 22 10:17:38 2014 -0700
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Oct 22 10:33:36 2014 -0700

    mtd: docg3: fix 'defined but not used' warning
    
    With CONFIG_OF=n, we can see the following warning:
    
       drivers/mtd/devices/docg3.c:2122:28: warning: 'docg3_dt_ids' defined but not used [-Wunused-variable]
        static struct of_device_id docg3_dt_ids[] = {
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Cc: Robert Jarzmik <robert.jarzmik at free.fr>
---
 drivers/mtd/devices/docg3.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index abd9466..0d9d3ee 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -2119,11 +2119,13 @@ static int __exit docg3_release(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
 static struct of_device_id docg3_dt_ids[] = {
 	{ .compatible = "m-systems,diskonchip-g3" },
 	{}
 };
 MODULE_DEVICE_TABLE(of, docg3_dt_ids);
+#endif
 
 static struct platform_driver g3_driver = {
 	.driver		= {



More information about the linux-mtd-cvs mailing list