Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: twl4030 - fix warnings without CONFIG_OF

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>

authored by

Andreas Kemnade and committed by
Dmitry Torokhov
71ed5514 eeb2ea4b

+3 -4
+3 -4
drivers/input/misc/twl4030-pwrbutton.c
··· 27 27 #include <linux/errno.h> 28 28 #include <linux/input.h> 29 29 #include <linux/interrupt.h> 30 - #include <linux/of.h> 30 + #include <linux/mod_devicetable.h> 31 + #include <linux/property.h> 31 32 #include <linux/platform_device.h> 32 33 #include <linux/mfd/twl.h> 33 34 ··· 133 132 } 134 133 } 135 134 136 - #ifdef CONFIG_OF 137 135 static const struct of_device_id twl4030_pwrbutton_dt_match_table[] = { 138 136 { 139 137 .compatible = "ti,twl4030-pwrbutton", ··· 145 145 { } 146 146 }; 147 147 MODULE_DEVICE_TABLE(of, twl4030_pwrbutton_dt_match_table); 148 - #endif 149 148 150 149 static struct platform_driver twl4030_pwrbutton_driver = { 151 150 .probe = twl4030_pwrbutton_probe, 152 151 .remove = twl4030_pwrbutton_remove, 153 152 .driver = { 154 153 .name = "twl4030_pwrbutton", 155 - .of_match_table = of_match_ptr(twl4030_pwrbutton_dt_match_table), 154 + .of_match_table = twl4030_pwrbutton_dt_match_table, 156 155 }, 157 156 }; 158 157 module_platform_driver(twl4030_pwrbutton_driver);