aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-designware-platdrv.c
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2022-03-03 12:17:13 -0700
committerWolfram Sang <wsa@kernel.org>2022-03-11 21:54:21 +0100
commitd0583229bcf5090495d0621892d5da93d9fb6e3c (patch)
treef059d9de1196c8740b693303dbf819d25879e5c6 /drivers/i2c/busses/i2c-designware-platdrv.c
parenti2c: mediatek: Add i2c compatible for Mediatek MT8168 (diff)
downloadlinux-dev-d0583229bcf5090495d0621892d5da93d9fb6e3c.tar.xz
linux-dev-d0583229bcf5090495d0621892d5da93d9fb6e3c.zip
i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused
When CONFIG_PM is set but CONFIG_PM_SLEEP is not, two compiler warnings appear: drivers/i2c/busses/i2c-designware-platdrv.c:444:12: error: unused function 'dw_i2c_plat_suspend' [-Werror,-Wunused-function] static int dw_i2c_plat_suspend(struct device *dev) ^ drivers/i2c/busses/i2c-designware-platdrv.c:465:12: error: unused function 'dw_i2c_plat_resume' [-Werror,-Wunused-function] static int dw_i2c_plat_resume(struct device *dev) ^ 2 errors generated. These functions are only used in SET_LATE_SYSTEM_SLEEP_PM_OPS(), which is defined as empty when CONFIG_PM_SLEEP is not defined. Mark the functions as __maybe_unused to make it clear that these functions might be unused in this configuration. Fixes: c57813b8b288 ("i2c: designware: Lock the adapter while setting the suspended flag") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-platdrv.c')
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 116a297d1f6b..70ade5306e45 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -441,7 +441,7 @@ static int dw_i2c_plat_runtime_suspend(struct device *dev)
return 0;
}
-static int dw_i2c_plat_suspend(struct device *dev)
+static int __maybe_unused dw_i2c_plat_suspend(struct device *dev)
{
struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
@@ -462,7 +462,7 @@ static int dw_i2c_plat_runtime_resume(struct device *dev)
return 0;
}
-static int dw_i2c_plat_resume(struct device *dev)
+static int __maybe_unused dw_i2c_plat_resume(struct device *dev)
{
struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);