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

drivers/soc/litex: drop obsolete dependency on COMPILE_TEST

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), it
is possible to test-build any driver which depends on OF on any
architecture by explicitly selecting OF. Therefore depending on
COMPILE_TEST as an alternative is no longer needed.

It is actually better to always build such drivers with OF enabled,
so that the test builds are closer to how each driver will actually be
built on its intended target. Building them without OF may not test
much as the compiler will optimize out potentially large parts of the
code. In the worst case, this could even pop false positive warnings.
Dropping COMPILE_TEST here improves the quality of our testing and
avoids wasting time on non-existent issues.

As a minor optimization, this also lets us drop of_match_ptr() and
ifdef-guarding, as we now know what they will resolve to, we might as
well save cpp some work.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Gabriel Somlo <gsomlo@gmail.com>
Cc: Karol Gugala <kgugala@antmicro.com>
Cc: Mateusz Holenko <mholenko@antmicro.com>
Cc: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20240617133004.59887629@endymion.delvare
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Jean Delvare and committed by
Arnd Bergmann
4b381cf4 94811b40

+2 -4
+1 -1
drivers/soc/litex/Kconfig
··· 7 7 8 8 config LITEX_SOC_CONTROLLER 9 9 tristate "Enable LiteX SoC Controller driver" 10 - depends on OF || COMPILE_TEST 10 + depends on OF 11 11 depends on HAS_IOMEM 12 12 select LITEX 13 13 help
+1 -3
drivers/soc/litex/litex_soc_ctrl.c
··· 82 82 return NOTIFY_DONE; 83 83 } 84 84 85 - #ifdef CONFIG_OF 86 85 static const struct of_device_id litex_soc_ctrl_of_match[] = { 87 86 {.compatible = "litex,soc-controller"}, 88 87 {}, 89 88 }; 90 89 MODULE_DEVICE_TABLE(of, litex_soc_ctrl_of_match); 91 - #endif /* CONFIG_OF */ 92 90 93 91 static int litex_soc_ctrl_probe(struct platform_device *pdev) 94 92 { ··· 128 130 static struct platform_driver litex_soc_ctrl_driver = { 129 131 .driver = { 130 132 .name = "litex-soc-controller", 131 - .of_match_table = of_match_ptr(litex_soc_ctrl_of_match) 133 + .of_match_table = litex_soc_ctrl_of_match, 132 134 }, 133 135 .probe = litex_soc_ctrl_probe, 134 136 .remove_new = litex_soc_ctrl_remove,