From patchwork Fri Feb 6 06:09:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 5788741 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C25C1BF440 for ; Fri, 6 Feb 2015 06:10:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8E8F20172 for ; Fri, 6 Feb 2015 06:10:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16A4220166 for ; Fri, 6 Feb 2015 06:10:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754517AbbBFGJ7 (ORCPT ); Fri, 6 Feb 2015 01:09:59 -0500 Received: from mail-ig0-f170.google.com ([209.85.213.170]:46169 "EHLO mail-ig0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbbBFGJ6 (ORCPT ); Fri, 6 Feb 2015 01:09:58 -0500 Received: by mail-ig0-f170.google.com with SMTP id l13so357488iga.1; Thu, 05 Feb 2015 22:09:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=kV5rbfqH1EoE5flceRfKYWQFSMDIv6hPmqWV87mmdP4=; b=CDcLSZryd7Ri92z5QQ4F03GceW+XHpl9Ui8Cj2IF4plqBcTVzM5ytAHDYfe8Ppd1zK ZlhmAnIv6Vdy1vGajmrm+Y13N2pdxu9eISkXDPXUYznLTIaVNS8YfPKy1Vh0tfMELZ0D ZC1272NZoG1RqPlMMpzg2nD5IXCn9El5KcYASk5U31WrxREpvi9/9yMbEGBjSyEebue0 jBvtgIlTJ5jK3Tug9dfZraw7uQa7RHU56f9HCOUVhwyfykvKO01MfTepjAQYVDfJL7/s JR9cefuGZrzJbnlmX7SgR8VB0UGGURld/gOxCx8AqYzEgXJzYyarJoFN/yPFalWL6ity nm6Q== X-Received: by 10.43.140.196 with SMTP id jb4mr938263icc.90.1423202997653; Thu, 05 Feb 2015 22:09:57 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1301:704d:a2ff:c2e1:c373]) by mx.google.com with ESMTPSA id mi3sm744487igb.13.2015.02.05.22.09.55 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 05 Feb 2015 22:09:56 -0800 (PST) Date: Thu, 5 Feb 2015 22:09:53 -0800 From: Dmitry Torokhov To: Sonic Zhang Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: bfin_rotary - mark suspend and resume code as __maybe_unused Message-ID: <20150206060953.GA34087@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of using #ifdef to guard potentially unused suspend and resume code let's mark them as __maybe_unused so they still get discarded if they are not used but we do not get warning. This allows for better compile coverage. Signed-off-by: Dmitry Torokhov Acked-by: Sonic Zhang --- drivers/input/misc/bfin_rotary.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c index a39793c..09d7612 100644 --- a/drivers/input/misc/bfin_rotary.c +++ b/drivers/input/misc/bfin_rotary.c @@ -232,8 +232,7 @@ static int bfin_rotary_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int bfin_rotary_suspend(struct device *dev) +static int __maybe_unused bfin_rotary_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct bfin_rot *rotary = platform_get_drvdata(pdev); @@ -248,7 +247,7 @@ static int bfin_rotary_suspend(struct device *dev) return 0; } -static int bfin_rotary_resume(struct device *dev) +static int __maybe_unused bfin_rotary_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct bfin_rot *rotary = platform_get_drvdata(pdev); @@ -266,20 +265,15 @@ static int bfin_rotary_resume(struct device *dev) return 0; } -static const struct dev_pm_ops bfin_rotary_pm_ops = { - .suspend = bfin_rotary_suspend, - .resume = bfin_rotary_resume, -}; -#endif +static SIMPLE_DEV_PM_OPS(bfin_rotary_pm_ops, + bfin_rotary_suspend, bfin_rotary_resume); static struct platform_driver bfin_rotary_device_driver = { .probe = bfin_rotary_probe, .remove = bfin_rotary_remove, .driver = { .name = "bfin-rotary", -#ifdef CONFIG_PM .pm = &bfin_rotary_pm_ops, -#endif }, }; module_platform_driver(bfin_rotary_device_driver);