Skip to content

Commit 4b381cf

Browse files
jdelvarearndb
authored andcommitted
drivers/soc/litex: drop obsolete dependency on COMPILE_TEST
Since commit 0166dc1 ("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>
1 parent 94811b4 commit 4b381cf

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/soc/litex/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ config LITEX
77

88
config LITEX_SOC_CONTROLLER
99
tristate "Enable LiteX SoC Controller driver"
10-
depends on OF || COMPILE_TEST
10+
depends on OF
1111
depends on HAS_IOMEM
1212
select LITEX
1313
help

drivers/soc/litex/litex_soc_ctrl.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,11 @@ static int litex_reset_handler(struct notifier_block *this, unsigned long mode,
8282
return NOTIFY_DONE;
8383
}
8484

85-
#ifdef CONFIG_OF
8685
static const struct of_device_id litex_soc_ctrl_of_match[] = {
8786
{.compatible = "litex,soc-controller"},
8887
{},
8988
};
9089
MODULE_DEVICE_TABLE(of, litex_soc_ctrl_of_match);
91-
#endif /* CONFIG_OF */
9290

9391
static int litex_soc_ctrl_probe(struct platform_device *pdev)
9492
{
@@ -130,7 +128,7 @@ static void litex_soc_ctrl_remove(struct platform_device *pdev)
130128
static struct platform_driver litex_soc_ctrl_driver = {
131129
.driver = {
132130
.name = "litex-soc-controller",
133-
.of_match_table = of_match_ptr(litex_soc_ctrl_of_match)
131+
.of_match_table = litex_soc_ctrl_of_match,
134132
},
135133
.probe = litex_soc_ctrl_probe,
136134
.remove_new = litex_soc_ctrl_remove,

0 commit comments

Comments
 (0)