]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mfd: as3722: Mark PM functions as __maybe_unused
authorArnd Bergmann <arnd@arndb.de>
Tue, 8 Dec 2015 15:21:05 +0000 (16:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Feb 2019 08:05:14 +0000 (09:05 +0100)
commit a7b956fd38dd217dd78e3058110929f5ac914df1 upstream.

The newly introduced as3722_i2c_suspend/resume functions are built
unconditionally, but only used when power management is enabled,
so we get a warning otherwise:

drivers/mfd/as3722.c:427:12: warning: 'as3722_i2c_suspend' defined but not used [-Wunused-function]
drivers/mfd/as3722.c:438:12: warning: 'as3722_i2c_resume' defined but not used [-Wunused-function]

This marks them both as __maybe_unused, which avoids an ugly #ifdef
and gives us best compile-time coverage. When they are unused, the
compiler will silently drop the functions from its output.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 35deff7eb212 ("mfd: as3722: Handle interrupts on suspend")
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mfd/as3722.c

index 3b21eb4bc480ef13c618294ad4e443ddec45b1ed..e1f597f97f869e65297c3343b38aad0c2a48490f 100644 (file)
@@ -424,7 +424,7 @@ static int as3722_i2c_remove(struct i2c_client *i2c)
        return 0;
 }
 
-static int as3722_i2c_suspend(struct device *dev)
+static int __maybe_unused as3722_i2c_suspend(struct device *dev)
 {
        struct as3722 *as3722 = dev_get_drvdata(dev);
 
@@ -435,7 +435,7 @@ static int as3722_i2c_suspend(struct device *dev)
        return 0;
 }
 
-static int as3722_i2c_resume(struct device *dev)
+static int __maybe_unused as3722_i2c_resume(struct device *dev)
 {
        struct as3722 *as3722 = dev_get_drvdata(dev);