]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: twl4030 - fix warnings without CONFIG_OF
authorAndreas Kemnade <andreas@kemnade.info>
Thu, 8 Jan 2026 05:52:14 +0000 (21:52 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 8 Jan 2026 05:54:29 +0000 (21:54 -0800)
There are unused variables without CONFIG_OF:
drivers/input/misc/twl4030-pwrbutton.c:41:44: error: unused variable 'twl4030_chipdata' [-Werror,-Wunused-const-variable]
   41 | static const struct twl_pwrbutton_chipdata twl4030_chipdata = {
      |                                            ^~~~~~~~~~~~~~~~
drivers/input/misc/twl4030-pwrbutton.c:46:44: error: unused variable 'twl6030_chipdata' [-Werror,-Wunused-const-variable]
   46 | static const struct twl_pwrbutton_chipdata twl6030_chipdata = {

Fix that by avoiding some #ifdef CONFIG_OF

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512220251.jDE8tKup-lkp@intel.com/
Fixes: ec8fce2a57e9 ("Input: twl4030 - add TWL603x power button")
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20251227115918.76969-1-andreas@kemnade.info
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/twl4030-pwrbutton.c

index d82a3fb28d9553cc205b7d32e3c9c503c4a60459..b0feef19515d2afa3249dfbc488213e3d0c0ea53 100644 (file)
@@ -27,7 +27,8 @@
 #include <linux/errno.h>
 #include <linux/input.h>
 #include <linux/interrupt.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 #include <linux/platform_device.h>
 #include <linux/mfd/twl.h>
 
@@ -132,7 +133,6 @@ static void twl4030_pwrbutton_remove(struct platform_device *pdev)
        }
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id twl4030_pwrbutton_dt_match_table[] = {
        {
                .compatible = "ti,twl4030-pwrbutton",
@@ -145,14 +145,13 @@ static const struct of_device_id twl4030_pwrbutton_dt_match_table[] = {
        { }
 };
 MODULE_DEVICE_TABLE(of, twl4030_pwrbutton_dt_match_table);
-#endif
 
 static struct platform_driver twl4030_pwrbutton_driver = {
        .probe          = twl4030_pwrbutton_probe,
        .remove         = twl4030_pwrbutton_remove,
        .driver         = {
                .name   = "twl4030_pwrbutton",
-               .of_match_table = of_match_ptr(twl4030_pwrbutton_dt_match_table),
+               .of_match_table = twl4030_pwrbutton_dt_match_table,
        },
 };
 module_platform_driver(twl4030_pwrbutton_driver);