From patchwork Mon Sep 12 15:32:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101809 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp909886qgf; Mon, 12 Sep 2016 08:34:12 -0700 (PDT) X-Received: by 10.98.103.132 with SMTP id t4mr30097897pfj.12.1473694452485; Mon, 12 Sep 2016 08:34:12 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p190si22142446pfb.292.2016.09.12.08.34.12; Mon, 12 Sep 2016 08:34:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-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-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934197AbcILPdq (ORCPT + 4 others); Mon, 12 Sep 2016 11:33:46 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:62684 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934192AbcILPdl (ORCPT ); Mon, 12 Sep 2016 11:33:41 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LkySz-1b9JbM1qFR-00anIq; Mon, 12 Sep 2016 17:33:25 +0200 From: Arnd Bergmann To: Mauro Carvalho Chehab Cc: Arnd Bergmann , Sakari Ailus , =?utf-8?q?Pali_Roh=C3=A1r?= , Pavel Machek , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] [media] ad5820: use __maybe_unused for PM functions Date: Mon, 12 Sep 2016 17:32:57 +0200 Message-Id: <20160912153322.3098750-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:ukRMbokWa18ZRSqOHzldmskPrKvFsJA/tU17Bw3Ak0mMRc1UCru rJAX8H6nco8tvNsIzwSCkTifA3ks6p/IyOoDzgqYBNaR2qhZpZK9OWYfwdOnyrzClCXy4h8 I7pxn8qfjLmHHmgWJMjRwzwvwcGav21XTB/38CbgwsC7AZMgB0f84Tk0EeLkPC7+wUOT/Ac HSmb+PdDARZM1kMJLm/Mg== X-UI-Out-Filterresults: notjunk:1; V01:K0:nfatZiTbDo4=:bnimZBZkKURbpE3uzFPCj0 cE7KwlEpg6g+sf5LzknSS2Ky/8i+Bw0vmDb9GTDeyPKk/cwacoZWKk86NFZ50KFYNegEHOfeb tWIxz/dKi4SOsav0evdQ7vS5jkG4qw+GMvaN1atfZmJR6vsVexxzMvANfaP44SBtta79itKOS r/36bWxCctUPUzxMSTUQjWiCMr/3dwA0jwARYm2ux+eCMamGhtOntxxtzOPdetLyjeaMJ4M8q FHX7FzPLnC3lDUCAkJ+VvXHXjtd4U6JDmrvl7DKMJWEbyEgq9VwGWjhN3uGEAKe2hvJPF+HiC dSPbno5w8WK4XstlU2y513jdrCQ3paZPBsIqeI88c0n7XdnsC8Gegp6PtR+t6ixBUMjcRPbGR tpyE4bqM0Us1KNa8DHfKm1FYZUWrAijE9krrzsDHMgIxAijwdQ8m6dUAHcglIz0+CQ3AMrSKM eNmtIu38ysYMPherKqb0mHxTP6WEiQLEcM+XeRScN9tuJiYKmbvZoRH0Vxw1tX2UkLLdwnFrJ FtZxUtwAOY2oZeFr5lgIb/Bi+y7GE9gM5R4a70x1zcorD634fPoJz98IAuBhi/vo9HUCDkI4r 4C9+6QIq2MOvznScJ8G9kEB7CnGtZJu2v3SO+5SvESEpOwo6fO7j6/4lfSe/+67nHHbY3BuKg bxDFdXhIY3VfqT8aWKmsfpZhLPBSH+gAPg2QvIFjUqlAfc2HJ01mTeKHTlCpONpiWZO4= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The new ad5820 driver uses #ifdef to hide the suspend/resume functions, but gets it wrong when CONFIG_PM_SLEEP is disabled: drivers/media/i2c/ad5820.c:286:12: error: 'ad5820_resume' defined but not used [-Werror=unused-function] drivers/media/i2c/ad5820.c:274:12: error: 'ad5820_suspend' defined but not used [-Werror=unused-function] This replaces the #ifdef with a __maybe_unused annotation that is simpler and harder to get wrong, avoiding the warning. Signed-off-by: Arnd Bergmann Fixes: bee3d5115611 ("[media] ad5820: Add driver for auto-focus coil") --- drivers/media/i2c/ad5820.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c index fd4c5f67163d..beab2f381b81 100644 --- a/drivers/media/i2c/ad5820.c +++ b/drivers/media/i2c/ad5820.c @@ -269,9 +269,7 @@ static const struct v4l2_subdev_internal_ops ad5820_internal_ops = { /* * I2C driver */ -#ifdef CONFIG_PM - -static int ad5820_suspend(struct device *dev) +static int __maybe_unused ad5820_suspend(struct device *dev) { struct i2c_client *client = container_of(dev, struct i2c_client, dev); struct v4l2_subdev *subdev = i2c_get_clientdata(client); @@ -283,7 +281,7 @@ static int ad5820_suspend(struct device *dev) return ad5820_power_off(coil, false); } -static int ad5820_resume(struct device *dev) +static int __maybe_unused ad5820_resume(struct device *dev) { struct i2c_client *client = container_of(dev, struct i2c_client, dev); struct v4l2_subdev *subdev = i2c_get_clientdata(client); @@ -295,13 +293,6 @@ static int ad5820_resume(struct device *dev) return ad5820_power_on(coil, true); } -#else - -#define ad5820_suspend NULL -#define ad5820_resume NULL - -#endif /* CONFIG_PM */ - static int ad5820_probe(struct i2c_client *client, const struct i2c_device_id *devid) {