• Nathan Chancellor's avatar
    soc: mediatek: SVS: Use DEFINE_SIMPLE_DEV_PM_OPS for svs_pm_ops · c749d676
    Nathan Chancellor authored
    When building this driver for an architecture that does not support
    CONFIG_PM_SLEEP, such as hexagon, the following warnings occur:
    
      drivers/soc/mediatek/mtk-svs.c:1481:12: error: unused function 'svs_suspend' [-Werror,-Wunused-function]
      static int svs_suspend(struct device *dev)
                 ^
      drivers/soc/mediatek/mtk-svs.c:1515:12: error: unused function 'svs_resume' [-Werror,-Wunused-function]
      static int svs_resume(struct device *dev)
                 ^
      2 errors generated.
    
    This happens because SIMPLE_DEV_PM_OPS uses SET_SYSTEM_SLEEP_PM_OPS,
    which evaluates to nothing when CONFIG_PM_SLEEP is not set, leaving the
    functions unused in the eyes of the compiler.
    
    This problem was rectified in commit 1a3c7bb0 ("PM: core: Add new
    *_PM_OPS macros, deprecate old ones") with new macros. Use
    DEFINE_SIMPLE_DEV_PM_OPS to fix the warning while not changing
    svs_pm_ops when CONFIG_PM_SLEEP is set.
    
    Fixes: 681a02e9 ("soc: mediatek: SVS: introduce MTK SVS engine")
    Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
    Link: https://lore.kernel.org/r/20220622175649.1856337-1-nathan@kernel.orgSigned-off-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
    c749d676
mtk-svs.c 60.6 KB