From patchwork Fri Jan 8 01:33:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 7981581 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 1C11CBEEE5 for ; Fri, 8 Jan 2016 01:33:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D24B20149 for ; Fri, 8 Jan 2016 01:33:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 632F820120 for ; Fri, 8 Jan 2016 01:33:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753801AbcAHBdf (ORCPT ); Thu, 7 Jan 2016 20:33:35 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:35084 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753650AbcAHBde (ORCPT ); Thu, 7 Jan 2016 20:33:34 -0500 Received: by mail-pf0-f178.google.com with SMTP id 65so1796094pff.2; Thu, 07 Jan 2016 17:33:33 -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=j31fZM38TzxSi43asCWaOhd9lVjfFfQcsVLcmKKSOSo=; b=CrUZ7382Lp+MIqXRV038Rb2QXXCar4z3JTjANjpBDgYBc3mHoXooDnXj4X53jYLdgC M4j6BwbwBpG9bPDRkqhErMSMEKatBdgtW9b5qSf7+To4D6jI/kzVVKbiZV+aonlMtWge 3w5+X8tJ1CT3fPmS5S+8QazN8ktHjBw5BtW9TaWtRbsbCQRuiaFbEt1F6fSDd30EtwfJ XQ3m6wuzssyxtpt7VqlU340y0/TPqfi6bzueqeYik7kPhHMFCiLPBqQN293LeT3VAhRQ 8l/APFNw3qO2I7G0IzPKEz4Nx9K4mA7sSGtVwy7CUkhmHtxamZTBL1t7GmwMMhEtYgkk FgxA== X-Received: by 10.98.16.65 with SMTP id y62mr771612pfi.138.1452216812767; Thu, 07 Jan 2016 17:33:32 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1301:3438:d31f:8a03:32e6]) by smtp.gmail.com with ESMTPSA id 88sm410768pfl.9.2016.01.07.17.33.31 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 07 Jan 2016 17:33:31 -0800 (PST) Date: Thu, 7 Jan 2016 17:33:29 -0800 From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Vignesh R , Brad Griffis , Dave Gerlach , linux-kernel@vger.kernel.org Subject: [PATCH] Input: ti_am335x_tsc - use SIMPLE_DEV_PM_OPS Message-ID: <20160108013329.GA33290@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, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 doing the dance with macro that either resolves to a pointer or NULL, let's switch to using SIMPLE_DEV_PM_OPS(). Also let's mark suspend and resume methods as __maybe_unused instead of guarding them with an #ifdef and rely on linker to drop unused code. Doing so should allow better compile coverage. Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ti_am335x_tsc.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c index a21a07c..8b3f15c 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c @@ -487,8 +487,7 @@ static int titsc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int titsc_suspend(struct device *dev) +static int __maybe_unused titsc_suspend(struct device *dev) { struct titsc *ts_dev = dev_get_drvdata(dev); struct ti_tscadc_dev *tscadc_dev; @@ -504,7 +503,7 @@ static int titsc_suspend(struct device *dev) return 0; } -static int titsc_resume(struct device *dev) +static int __maybe_unused titsc_resume(struct device *dev) { struct titsc *ts_dev = dev_get_drvdata(dev); struct ti_tscadc_dev *tscadc_dev; @@ -521,14 +520,7 @@ static int titsc_resume(struct device *dev) return 0; } -static const struct dev_pm_ops titsc_pm_ops = { - .suspend = titsc_suspend, - .resume = titsc_resume, -}; -#define TITSC_PM_OPS (&titsc_pm_ops) -#else -#define TITSC_PM_OPS NULL -#endif +static SIMPLE_DEV_PM_OPS(titsc_pm_ops, titsc_suspend, titsc_resume); static const struct of_device_id ti_tsc_dt_ids[] = { { .compatible = "ti,am3359-tsc", }, @@ -541,7 +533,7 @@ static struct platform_driver ti_tsc_driver = { .remove = titsc_remove, .driver = { .name = "TI-am335x-tsc", - .pm = TITSC_PM_OPS, + .pm = &titsc_pm_ops, .of_match_table = ti_tsc_dt_ids, }, };