Skip to content

Commit fb2bdd3

Browse files
arndbmathieupoirier
authored andcommitted
remoteproc: stm32: fix incorrect optional pointers
Compile-testing without CONFIG_OF shows that the of_match_ptr() macro was used incorrectly here: drivers/remoteproc/stm32_rproc.c:662:34: warning: unused variable 'stm32_rproc_match' [-Wunused-const-variable] As in almost every driver, the solution is simply to remove the use of this macro. The same thing happened with the deprecated SIMPLE_DEV_PM_OPS(), but the corresponding warning was already shut up with __maybe_unused annotations, so fix those as well by using the correct DEFINE_SIMPLE_DEV_PM_OPS() macros and removing the extraneous __maybe_unused modifiers. For completeness, also add a pm_ptr() to let the PM ops be eliminated completely when CONFIG_PM is turned off. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202307242300.ia82qBTp-lkp@intel.com Fixes: 03bd158 ("remoteproc: stm32: use correct format strings on 64-bit") Fixes: 410119e ("remoteproc: stm32: wakeup the system by wdg irq") Fixes: 13140de ("remoteproc: stm32: add an ST stm32_rproc driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> Link: https://lore.kernel.org/r/20230724195704.2432382-1-arnd@kernel.org Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent 49f80a7 commit fb2bdd3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/remoteproc/stm32_rproc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ static void stm32_rproc_remove(struct platform_device *pdev)
921921
rproc_free(rproc);
922922
}
923923

924-
static int __maybe_unused stm32_rproc_suspend(struct device *dev)
924+
static int stm32_rproc_suspend(struct device *dev)
925925
{
926926
struct rproc *rproc = dev_get_drvdata(dev);
927927
struct stm32_rproc *ddata = rproc->priv;
@@ -932,7 +932,7 @@ static int __maybe_unused stm32_rproc_suspend(struct device *dev)
932932
return 0;
933933
}
934934

935-
static int __maybe_unused stm32_rproc_resume(struct device *dev)
935+
static int stm32_rproc_resume(struct device *dev)
936936
{
937937
struct rproc *rproc = dev_get_drvdata(dev);
938938
struct stm32_rproc *ddata = rproc->priv;
@@ -943,16 +943,16 @@ static int __maybe_unused stm32_rproc_resume(struct device *dev)
943943
return 0;
944944
}
945945

946-
static SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops,
947-
stm32_rproc_suspend, stm32_rproc_resume);
946+
static DEFINE_SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops,
947+
stm32_rproc_suspend, stm32_rproc_resume);
948948

949949
static struct platform_driver stm32_rproc_driver = {
950950
.probe = stm32_rproc_probe,
951951
.remove_new = stm32_rproc_remove,
952952
.driver = {
953953
.name = "stm32-rproc",
954-
.pm = &stm32_rproc_pm_ops,
955-
.of_match_table = of_match_ptr(stm32_rproc_match),
954+
.pm = pm_ptr(&stm32_rproc_pm_ops),
955+
.of_match_table = stm32_rproc_match,
956956
},
957957
};
958958
module_platform_driver(stm32_rproc_driver);

0 commit comments

Comments
 (0)