soc: mediatek: Let PMIC Wrapper and SCPSYS depend on OF
PATCH 1/1 soc: mediatek: Let PMIC Wrapper and SCPSYS depend on OF
With the following configuration options:CONFIG_OF is not setCONFIG_MTK_PMIC_WRAP=yCONFIG_MTK_SCPSYS=y
we get the following build warnings:
CC drivers/soc/mediatek/mtk-pmic-wrap.odrivers/soc/mediatek/mtk-pmic-wrap.c:2138:34: warning: ‘of_pwrap_match_tbl’ defined but not used [-Wunused-const-variable=] drivers/soc/mediatek/mtk-pmic-wrap.c:1953:34: warning: ‘of_slave_match_tbl’ defined but not used [-Wunused-const-variable=]
CC drivers/soc/mediatek/mtk-scpsys.odrivers/soc/mediatek/mtk-scpsys.c:1084:34: warning: ‘of_scpsys_match_tbl’ defined but not used [-Wunused-const-variable=]
Looking at the code, both drivers can only bind to OF-defined device nodes, so these drivers are useless without OF and should therefore depend on it.
Developers or QA teams who wish to test-build the code can still do so by enabling CONFIG_OF, which is available on all architectures and has no dependencies.
--- drivers/soc/mediatek/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
drivers/soc/mediatek/Kconfig +2 -0
@@ -37,6 +37,7 @@ config MTK_INFRACFG config MTK_PMIC_WRAP tristate "MediaTek PMIC Wrapper Support" depends on RESET_CONTROLLER + depends on OF select REGMAP help Say yes here to add support for MediaTek PMIC Wrapper found
@@ -46,6 +47,7 @@ config MTK_PMIC_WRAP config MTK_SCPSYS bool "MediaTek SCPSYS Support" default ARCH_MEDIATEK + depends on OF select REGMAP select MTK_INFRACFG select PM_GENERIC_DOMAINS if PM
Signature · 2 lines
Jean Delvare SUSE L3 Support
AngeloGioacchino Del Regno
maintainerIl 28/07/22 11:22, Jean Delvare ha scritto:
Quoted 12 lines
With the following configuration options:
CONFIG_OFis not setCONFIG_MTK_PMIC_WRAP=yCONFIG_MTK_SCPSYS=y
we get the following build warnings:CC
drivers/soc/mediatek/mtk-pmic-wrap.odrivers/soc/mediatek/mtk-pmic-wrap.c:2138:34: warning: ‘of_pwrap_match_tbl’ defined but not used [-Wunused-const-variable=]drivers/soc/mediatek/mtk-pmic-wrap.c:1953:34: warning: ‘of_slave_match_tbl’ defined but not used [-Wunused-const-variable=]
CCdrivers/soc/mediatek/mtk-scpsys.odrivers/soc/mediatek/mtk-scpsys.c:1084:34: warning: ‘of_scpsys_match_tbl’ defined but not used [-Wunused-const-variable=]
Quoted 4 lines
Looking at the code, both drivers can only bind to OF-defined device nodes, so these drivers are useless without OF and should therefore depend on it.
Hello Jean,
I would prefer that you solve this warning by removing of_match_ptr() from both drivers instead.
Regards,
Angelo
Quoted 32 lines
Developers or QA teams who wish to test-build the code can still do so by enabling
CONFIG_OF, which is available on all architectures and has no dependencies.Signed-off-by Jean Delvare <[email protected]>Reported-by kernel test robot <[email protected]>Cc Matthias Brugger <[email protected]>Cc Chenglin Xu <[email protected]>--- drivers/soc/mediatek/Kconfig | 2 ++ 1 file changed, 2 insertions(+)drivers/soc/mediatek/Kconfig +2
-0@@ -37,6 +37,7 @@ config MTK_INFRACFG config MTK_PMIC_WRAP tristate "MediaTek PMIC Wrapper Support" depends on RESET_CONTROLLER + depends on OF select REGMAP help Say yes here to add support for MediaTek PMIC Wrapper found@@ -46,6 +47,7 @@ config MTK_PMIC_WRAP config MTK_SCPSYS bool "MediaTek SCPSYS Support" default ARCH_MEDIATEK + depends on OF select REGMAP select MTK_INFRACFG select PM_GENERIC_DOMAINS if PM
Hi Angelo,
Quoted 13 lines · AngeloGioacchino Del Regno
Il 28/07/22 11:22, Jean Delvare ha scritto:
Quoted 12 lines
With the following configuration options:
CONFIG_OFis not setCONFIG_MTK_PMIC_WRAP=yCONFIG_MTK_SCPSYS=y
we get the following build warnings:CC
drivers/soc/mediatek/mtk-pmic-wrap.odrivers/soc/mediatek/mtk-pmic-wrap.c:2138:34: warning: ‘of_pwrap_match_tbl’ defined but not used [-Wunused-const-variable=]drivers/soc/mediatek/mtk-pmic-wrap.c:1953:34: warning: ‘of_slave_match_tbl’ defined but not used [-Wunused-const-variable=]
CCdrivers/soc/mediatek/mtk-scpsys.odrivers/soc/mediatek/mtk-scpsys.c:1084:34: warning: ‘of_scpsys_match_tbl’ defined but not used [-Wunused-const-variable=]
Quoted 6 lines
Quoted 3 lines
Looking at the code, both drivers can only bind to OF-defined device nodes, so these drivers are useless without OF and should therefore depend on it.
I would prefer that you solve this warning by removing
of_match_ptr()from both drivers instead.
Actually we could do both. Once the drivers depend on OF, of_match_ptr(_ptr) will always resolve to (_ptr) so we can indeed save the preprocessor some work.
Signature · 2 lines
Jean Delvare SUSE L3 Support