From patchwork Sun Oct 9 14:34:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 9368517 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 B971E6077E for ; Sun, 9 Oct 2016 14:36:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A95D020855 for ; Sun, 9 Oct 2016 14:36:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D89B2891D; Sun, 9 Oct 2016 14:36:55 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 21D1920855 for ; Sun, 9 Oct 2016 14:36:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1btFBj-0008Dm-LV; Sun, 09 Oct 2016 14:34:51 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1btFBf-0008DB-RY for linux-arm-kernel@lists.infradead.org; Sun, 09 Oct 2016 14:34:48 +0000 Received: by mail-pf0-x242.google.com with SMTP id 190so5870951pfv.1 for ; Sun, 09 Oct 2016 07:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=WrIblcpjPKOrZzHsSiIo7uIxn0Uw/KOuM3+uJs1ePwk=; b=uc3k3Zp5AGsZwUkkTQfa/iHnBnOBKETy/oMrWoyChoXpsou2BbRtl+YDooIIv9FKu4 Q4J50M5hHey9Z4TjowCERknsqHUpO3PM3Ml1Aah97mEUp+UR3Lp6k2jJWghni5fbU9Tu A3cC+48J/nvI//s3XdTTX+c1/VSP3pY3dwlZZYT1Ox8cQX5X/dNi22S3SBDyRREmLy55 s9ZgJbHqxI/UQzBI77/ZHt5fCHnw0dLAZESqUXdFn2LZGCk2hI5b36uTAx/xmaRGmFvM HG6nt6WzTJsL/4CV8Ccr2f8kR9y1GuvjPzuCnyrgLBiYPRl/KGEhN/eF+emKr/myA69V 3W4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WrIblcpjPKOrZzHsSiIo7uIxn0Uw/KOuM3+uJs1ePwk=; b=hZZK1KR4yfzt5YsRaqLcqTy0FbYpucXz9jCp9pbH6YU+vhjRCC6w4ZdFiVVWIbLWwb FhYl4YBoyZMMnRj8zuic0WdwLtj6tINvCA6DM8lQTnOKsjGRjZdKqOn+snpDiYQokjiU IYWB7qJxBx7wWrZZ7D7gwDHhXb8k0jYkmd1jVRschtYpLVgDiPNbrZn2Vx3557PcpVse I8sinmrokfDhmQOtfUif2vuKUfLvGUPEdXnR0f7G/YHH/NMHrjN0aLHR4qATgHAF9DV+ L/QkjYenqATIsoGgPTxUnyQpOGcgEb+xjas6igEwFR32ysmuuSR5Oekl5NdfuYhA/9AZ RFoA== X-Gm-Message-State: AA6/9RngfhPnhyUtOm0SyT4AUPa1HpHnn0wHSI83xwS33iKOW6+87XF/86lFVFWtzIZQDw== X-Received: by 10.98.129.132 with SMTP id t126mr45923974pfd.59.1476023665731; Sun, 09 Oct 2016 07:34:25 -0700 (PDT) Received: from localhost.localdomain ([103.51.74.65]) by smtp.gmail.com with ESMTPSA id n85sm27497582pfb.31.2016.10.09.07.34.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 09 Oct 2016 07:34:25 -0700 (PDT) From: Anand Moon To: Alan Stern , Greg Kroah-Hartman , Kukjin Kim , Krzysztof Kozlowski , Javier Martinez Canillas Subject: [PATCH 1/2] host: ehci-exynos: Convert to use the SET_SYSTEM_SLEEP_PM_OPS Date: Sun, 9 Oct 2016 14:34:14 +0000 Message-Id: <1476023655-3232-1-git-send-email-linux.amoon@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161009_073448_036398_4BBB72BA X-CRM114-Status: GOOD ( 14.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anand Moon , linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Move the ehci-exynos system PM callbacks within #ifdef CONFIG_PM_SLEEP as to avoid them being build when not used. This also allows us to use the SET_SYSTEM_SLEEP_PM_OPS macro which simplifies the code. Signed-off-by: Anand Moon --- drivers/usb/host/ehci-exynos.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index 42e5b66..1899900 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -251,7 +251,7 @@ static int exynos_ehci_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int exynos_ehci_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); @@ -292,15 +292,13 @@ static int exynos_ehci_resume(struct device *dev) ehci_resume(hcd, false); return 0; } -#else -#define exynos_ehci_suspend NULL -#define exynos_ehci_resume NULL -#endif static const struct dev_pm_ops exynos_ehci_pm_ops = { - .suspend = exynos_ehci_suspend, - .resume = exynos_ehci_resume, + SET_SYSTEM_SLEEP_PM_OPS(exynos_ehci_suspend, exynos_ehci_resume) }; +#endif /* CONFIG_PM_SLEEP */ + +#define DEV_PM_OPS IS_ENABLED(CONFIG_PM_SLEEP) ? &exynos_ehci_pm_ops : NULL #ifdef CONFIG_OF static const struct of_device_id exynos_ehci_match[] = { @@ -317,7 +315,7 @@ static struct platform_driver exynos_ehci_driver = { .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "exynos-ehci", - .pm = &exynos_ehci_pm_ops, + .pm = DEV_PM_OPS, .of_match_table = of_match_ptr(exynos_ehci_match), } };