From patchwork Sun Apr 23 14:10:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Bedarkar X-Patchwork-Id: 9694845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 490D660245 for ; Sun, 23 Apr 2017 14:11:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 349D826538 for ; Sun, 23 Apr 2017 14:11:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27F9E26CFF; Sun, 23 Apr 2017 14:11:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1954826538 for ; Sun, 23 Apr 2017 14:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1045532AbdDWOLY (ORCPT ); Sun, 23 Apr 2017 10:11:24 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:34173 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754021AbdDWOLX (ORCPT ); Sun, 23 Apr 2017 10:11:23 -0400 Received: by mail-io0-f194.google.com with SMTP id h41so40986815ioi.1; Sun, 23 Apr 2017 07:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=5IWjb0937/twBHh2L0XtDNJo7mHVDMcikPLPKirS4+8=; b=jSYm08NPljoAmQ9EAOouBqwvwnIJKVx3MZyK2yUBESkoKArGKN1siFth0Ag3Vu8eHM F+agRJWBAySiEsN4W38O/VssrNWyVt4qIOugrwS9ZfH0zxchrs6dI1iITNXm2eSj3byI m3e4HTcuwMeg0f1zyLDxU8ZX/WWdscZla7H75+bZdrq3So8XEkxCKzQ8zYUus1LN5zv3 dSkKuVTh7JtycLn3PbVr43NFwmykRMSmR9yALxfR2XnYm1FeNoE1CGlP++Ot1/s+prqr WJ6x9GEm7Kj1XxyNic313UDu12I9Mk0vPfmcDLjtkH6aMBeXOguHzDU5xAR0sLC7BvBO UhIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5IWjb0937/twBHh2L0XtDNJo7mHVDMcikPLPKirS4+8=; b=p/AZOmTcX0pPYymlVlVmQDV46Ga1BizKeu0TimHGtr26s2I5OGsm7VG2E8q+yNXUvM PEwKhPqOeBi11wVbV6kwhG3gTYCGwV72gWSZi9VU7A8tgD1V6cDFoUi7Gb7NrKtyOYwR ZkqMTeF2HwrlIhCfCnAJyqMmFun5PK843XJxJh4DxGkKWdN5tz5jHvjUfYmJPAx2UtlN 01fVAGOE2vMPm46SFkw7WRse96uI//WTyi/PScUkDHlkXOnCmi22hwD+QEWdA60r1tI9 PMNbOtFHFkG7lebw9I+Zw7bLjbWEdce5Gaqn1b6y5/E0rsNOyb57GUIGyBdo7vWoqXV/ X8qw== X-Gm-Message-State: AN3rC/5wPdstUNoscimG83DNsx/1oPi6Hd3aIxZREgs3xU+OqrCuPUAr JQJyOaeoWLUYtA== X-Received: by 10.98.148.2 with SMTP id m2mr20268954pfe.28.1492956682314; Sun, 23 Apr 2017 07:11:22 -0700 (PDT) Received: from localhost.localdomain ([182.156.103.175]) by smtp.gmail.com with ESMTPSA id s89sm25768180pfi.79.2017.04.23.07.11.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 07:11:21 -0700 (PDT) From: Rahul Bedarkar To: Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Rahul Bedarkar Subject: [PATCH] hwmon: tmp103: use SIMPLE_DEV_PM_OPS helper macro Date: Sun, 23 Apr 2017 19:40:51 +0530 Message-Id: <1492956651-15321-1-git-send-email-rahulbedarkar89@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace ifdefs with SIMPLE_DEV_PM_OPS helper macro. Signed-off-by: Rahul Bedarkar Acked-by: Heiko Schocher --- drivers/hwmon/tmp103.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/hwmon/tmp103.c b/drivers/hwmon/tmp103.c index d0bb28b..7f85b14 100644 --- a/drivers/hwmon/tmp103.c +++ b/drivers/hwmon/tmp103.c @@ -150,8 +150,7 @@ static int tmp103_probe(struct i2c_client *client, return PTR_ERR_OR_ZERO(hwmon_dev); } -#ifdef CONFIG_PM -static int tmp103_suspend(struct device *dev) +static int __maybe_unused tmp103_suspend(struct device *dev) { struct regmap *regmap = dev_get_drvdata(dev); @@ -159,7 +158,7 @@ static int tmp103_suspend(struct device *dev) TMP103_CONF_SD_MASK, 0); } -static int tmp103_resume(struct device *dev) +static int __maybe_unused tmp103_resume(struct device *dev) { struct regmap *regmap = dev_get_drvdata(dev); @@ -167,15 +166,7 @@ static int tmp103_resume(struct device *dev) TMP103_CONF_SD_MASK, TMP103_CONF_SD); } -static const struct dev_pm_ops tmp103_dev_pm_ops = { - .suspend = tmp103_suspend, - .resume = tmp103_resume, -}; - -#define TMP103_DEV_PM_OPS (&tmp103_dev_pm_ops) -#else -#define TMP103_DEV_PM_OPS NULL -#endif /* CONFIG_PM */ +static SIMPLE_DEV_PM_OPS(tmp103_dev_pm_ops, tmp103_suspend, tmp103_resume); static const struct i2c_device_id tmp103_id[] = { { "tmp103", 0 }, @@ -193,7 +184,7 @@ static struct i2c_driver tmp103_driver = { .driver = { .name = "tmp103", .of_match_table = of_match_ptr(tmp103_of_match), - .pm = TMP103_DEV_PM_OPS, + .pm = &tmp103_dev_pm_ops, }, .probe = tmp103_probe, .id_table = tmp103_id,