From patchwork Tue Nov 8 14:01:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101554 Delivered-To: patch@linaro.org Received: by 10.182.113.165 with SMTP id iz5csp1710282obb; Tue, 8 Nov 2016 06:03:36 -0800 (PST) X-Received: by 10.98.217.67 with SMTP id s64mr23470642pfg.66.1478613816399; Tue, 08 Nov 2016 06:03:36 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si37170634pga.164.2016.11.08.06.03.34; Tue, 08 Nov 2016 06:03:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752565AbcKHODb (ORCPT + 27 others); Tue, 8 Nov 2016 09:03:31 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:49764 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751134AbcKHOD0 (ORCPT ); Tue, 8 Nov 2016 09:03:26 -0500 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0Lj4n8-1ch0xo1xyY-00dDDf; Tue, 08 Nov 2016 15:02:18 +0100 From: Arnd Bergmann To: Jonathan Cameron Cc: Arnd Bergmann , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Greg Kroah-Hartman , Brian Masney , Eva Rachel Retuya , Bhumika Goyal , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: iio: tsl2583: fix unused function warning Date: Tue, 8 Nov 2016 15:01:44 +0100 Message-Id: <20161108140213.2270755-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:S+P6x4Aqd3j9aL+Gz9etLee2K07vjqXJkYgkeTtyR2WYhkwvdaI tZPH+E2bYiarRYywJ/cDaO1Drd8pAvhaG0cG5E8CpHkWY/G81Na1mLk5Ssk84T1yL/GVH0c t/wGweiBgwNceG50iBBikBvxzmAMaBuUfLhQE6UHEtn11XzthogRkOuAJzr6LAs3DIhjKsB zoY2MymuLWIr7hPrXz+gg== X-UI-Out-Filterresults: notjunk:1; V01:K0:1+K/GX5h0t8=:6gIMTF6bwP1Izzvk6g07J1 wP0ETJfUoyTcNHRv/gFZtBuxmRHN3yvBMpSz2od7jSXBoG7UHcHsEK6kp/2BXrZgJXwLKgYWx Vq/seDDZS59Y++u5LXnSZKQH4dJSmR1BDvhpOgSSpbQy8BydKZf8QIchw4J4kVCeCIgQiThtw hnL7sCA3JnVWvrYVSv4DHU/gagoK1bMxD+7nwis3p8RGu/c3CBuMdsNL8yOcgMWODFOt2bL4m 1SLxP3qLuejlZIVz9DO1GUN0H4SJEVlQnIT3lmmiDBHxW8Y8rUVDms2CUzOKnC2h5UmykWP4C RFg0CnewmvBKJMIdi3utndaJJDy6wN71bujdAASXU2lA70/yGFDlJQDexKqwPFV8JvP6JzhwV /trQc3CwooFutHaB6wSj9Le6Kw7NtNpWbT2Ud/zGImBl2e0d4/bjg0ZZkty9fp9Cj/YiS8szV H//1KyZFDvC0NStOoYLSKnKrpECIsLFiLovo+lAKAzv09vkoeE/xeYvITuBTsh/uB7hKegJeN PozYkLCi6KtG4IfHvYhunE/YLymsJ3HyhrIy3idQpon5uCQAzWSbuKJMY0hQO7M6jep8ZCR38 I5menLZnET1Gtnaqls3xI1AyVHmFitsMHe7Mdl9fsMMaMCbPXx5NNGhABuHnH4j3Emi7G3vyS XP4V1NqxXcaYih4k44v0eJMVtA/7ZkVWARSc2kjONHBE0wH4JdCiqp6nNfCeEncEoPL04e6II M9dUNXcdbzXgg30P Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Removing a call to the taos_chip_off() makes it unused when CONFIG_PM is disabled: drivers/staging/iio/light/tsl2583.c:438:12: error: ‘taos_chip_off’ defined but not used [-Werror=unused-function] This removes all the #ifdef in this file, and marks the PM functions as __maybe_unused instead, which is more reliable and gives us better compile time coverage. Fixes: 0561155f6fc5 ("staging: iio: tsl2583: don't shutdown chip when updating the lux table") Signed-off-by: Arnd Bergmann --- drivers/staging/iio/light/tsl2583.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) -- 2.9.0 diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index 7eab17f4557e..d74e33bacbf9 100644 --- a/drivers/staging/iio/light/tsl2583.c +++ b/drivers/staging/iio/light/tsl2583.c @@ -816,8 +816,7 @@ static int taos_probe(struct i2c_client *clientp, return 0; } -#ifdef CONFIG_PM_SLEEP -static int taos_suspend(struct device *dev) +static int __maybe_unused taos_suspend(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct tsl2583_chip *chip = iio_priv(indio_dev); @@ -834,7 +833,7 @@ static int taos_suspend(struct device *dev) return ret; } -static int taos_resume(struct device *dev) +static int __maybe_unused taos_resume(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct tsl2583_chip *chip = iio_priv(indio_dev); @@ -850,10 +849,6 @@ static int taos_resume(struct device *dev) } static SIMPLE_DEV_PM_OPS(taos_pm_ops, taos_suspend, taos_resume); -#define TAOS_PM_OPS (&taos_pm_ops) -#else -#define TAOS_PM_OPS NULL -#endif static struct i2c_device_id taos_idtable[] = { { "tsl2580", 0 }, @@ -863,7 +858,6 @@ static struct i2c_device_id taos_idtable[] = { }; MODULE_DEVICE_TABLE(i2c, taos_idtable); -#ifdef CONFIG_OF static const struct of_device_id taos2583_of_match[] = { { .compatible = "amstaos,tsl2580", }, { .compatible = "amstaos,tsl2581", }, @@ -871,15 +865,12 @@ static const struct of_device_id taos2583_of_match[] = { { }, }; MODULE_DEVICE_TABLE(of, taos2583_of_match); -#else -#define taos2583_of_match NULL -#endif /* Driver definition */ static struct i2c_driver taos_driver = { .driver = { .name = "tsl2583", - .pm = TAOS_PM_OPS, + .pm = &taos_pm_ops, .of_match_table = taos2583_of_match, }, .id_table = taos_idtable,