remoteproc/mtk_scp: surround DT device IDs with CONFIG_OF
Subsystems (2)
PATCH 1/1 remoteproc/mtk_scp: surround DT device IDs with CONFIG_OF
Now that this driver can be compiled with COMPILE_TEST, we have no guarantee that CONFIG_OF will also be defined. When that happens, a warning about mtk_scp_of_match being defined but unused will be reported so make sure this variable is only defined if of_match_ptr() actually uses it.
--- drivers/remoteproc/mtk_scp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/remoteproc/mtk_scp.c +2 -0
@@ -772,12 +772,14 @@ static const struct mtk_scp_of_data mt8192_of_data = { .host_to_scp_int_bit = MT8192_HOST_IPC_INT_BIT, }; +#if defined(CONFIG_OF )static const struct of_device_id mtk_scp_of_match[] = { { .compatible ="mediatek,mt8183-scp" , .data = &mt8183_of_data }, { .compatible ="mediatek,mt8192-scp" , .data = &mt8192_of_data }, {}, };MODULE_DEVICE_TABLE (of, mtk_scp_of_match); +#endif static struct platform_driver mtk_scp_driver = { .probe = scp_probe,
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
Mathieu Poirier
maintainerHi Alexander,
Quoted 19 lines · Alexandre Courbot
Now that this driver can be compiled with
COMPILE_TEST, we have no guarantee thatCONFIG_OFwill also be defined. When that happens, a warning aboutmtk_scp_of_matchbeing defined but unused will be reported so make sure this variable is only defined ifof_match_ptr()actually uses it.Fixes cbd2dca74926c0e4610c40923cc786b732c9e8ef remoteproc: scp: add COMPILE_TEST dependencyReported-by kernel test robot <[email protected]>Signed-off-by Alexandre Courbot <[email protected]>--- drivers/remoteproc/mtk_scp.c | 2 ++ 1 file changed, 2 insertions(+)drivers/remoteproc/mtk_scp.c +0
-0@@ -772,12 +772,14 @@ static const struct mtk_scp_of_data mt8192_of_data = { .host_to_scp_int_bit = MT8192_HOST_IPC_INT_BIT,
drivers/remoteproc/mtk_scp.c static const struct mtk_scp_of_data mt8192_of_data = { · line 782
Quoted 10 lines
drivers/remoteproc/mtk_scp.c +2
-0}; +#if defined(CONFIG_OF )static const struct of_device_id mtk_scp_of_match[] = { { .compatible ="mediatek,mt8183-scp" , .data = &mt8183_of_data }, { .compatible ="mediatek,mt8192-scp" , .data = &mt8192_of_data }, {}, };MODULE_DEVICE_TABLE (of, mtk_scp_of_match); +#endif
I think it is better to add a "depends on OF" in the Kconfig.
Thanks,
Mathieu
Quoted 6 lines
drivers/remoteproc/mtk_scp.c +0
-0static struct platform_driver mtk_scp_driver = { .probe = scp_probe,Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
Quoted 24 lines · Mathieu Poirier
Hi Alexander,
Quoted 21 lines · Alexandre Courbot
Now that this driver can be compiled with
COMPILE_TEST, we have no guarantee thatCONFIG_OFwill also be defined. When that happens, a warning aboutmtk_scp_of_matchbeing defined but unused will be reported so make sure this variable is only defined ifof_match_ptr()actually uses it.Fixes cbd2dca74926c0e4610c40923cc786b732c9e8ef remoteproc: scp: add COMPILE_TEST dependencyReported-by kernel test robot <[email protected]>Signed-off-by Alexandre Courbot <[email protected]>--- drivers/remoteproc/mtk_scp.c | 2 ++ 1 file changed, 2 insertions(+)drivers/remoteproc/mtk_scp.c +0
-0@@ -772,12 +772,14 @@ static const struct mtk_scp_of_data mt8192_of_data = { .host_to_scp_int_bit = MT8192_HOST_IPC_INT_BIT, };
Quoted 11 lines
drivers/remoteproc/mtk_scp.c static const struct mtk_scp_of_data mt8192_of_data = { · line 782
Quoted 8 lines
drivers/remoteproc/mtk_scp.c +2
-0+#if defined(CONFIG_OF )static const struct of_device_id mtk_scp_of_match[] = { { .compatible ="mediatek,mt8183-scp" , .data = &mt8183_of_data }, { .compatible ="mediatek,mt8192-scp" , .data = &mt8192_of_data }, {}, };MODULE_DEVICE_TABLE (of, mtk_scp_of_match); +#endif I think it is better to add a "depends on OF" in the
Kconfig.
That would reduce the efficiency of COMPILE_TEST, so I would prefer that we drop of_match_ptr(), which will result in the pointer always being populated and this being referenced - although unused when built without OF.
Regards,
Bjorn
This patch was applied to andersson/remoteproc.git (refs/heads/for-next):
Hello:
This patch was applied to andersson/remoteproc.git (refs/heads/for-next):
Quoted 11 lines · On Mon, 2 Nov 2020 16:40:07 +0900 you wrote:
Now that this driver can be compiled with
COMPILE_TEST, we have no guarantee thatCONFIG_OFwill also be defined. When that happens, a warning aboutmtk_scp_of_matchbeing defined but unused will be reported so make sure this variable is only defined ifof_match_ptr()actually uses it.Fixes cbd2dca74926c0e4610c40923cc786b732c9e8ef remoteproc: scp: add COMPILE_TEST dependencyReported-by kernel test robot <[email protected]>Signed-off-by Alexandre Courbot <[email protected]>[...]
Here is the summary with links:
- remoteproc/mtk_scp: surround DT device IDs with CONFIG_OF
https://git.kernel.org/andersson/remoteproc/c/b8ba90450331
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html