From patchwork Sun Oct 9 14:34:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 9368527 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 C20D06077E for ; Sun, 9 Oct 2016 14:47:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AACC228B09 for ; Sun, 9 Oct 2016 14:47:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F6B328B0D; Sun, 9 Oct 2016 14:47:12 +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=unavailable 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 4ADA928B09 for ; Sun, 9 Oct 2016 14:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750701AbcJIOrL (ORCPT ); Sun, 9 Oct 2016 10:47:11 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:33655 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750696AbcJIOrK (ORCPT ); Sun, 9 Oct 2016 10:47:10 -0400 Received: by mail-pa0-f66.google.com with SMTP id hh10so5478765pac.0; Sun, 09 Oct 2016 07:47:10 -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:in-reply-to:references; bh=8nyopd9bhVEiwPv+6DxY9goTdc8HOY1RZzwMkKpTo0A=; b=0Xx6mqydqcP8xiU758070gJbvjF5fEsLWEuPCfbGEG8ZbgJ6mfOTySHoMCBtZf8HYl pf9A4eA1EvOMqnuIev3y0JIxrhtA807nv8FAs/5LjIHPM013C86YJn/CLtDYkXvIu9Zn YnlLQSSgGQDcMvC6GjNi5EV643t0fXwsk8ehdnyPJxNjQNBLdThzmHT07belRJbfIxF1 iDR4lXce+o9YT0nVPnxQFJAcraIOCZrfMnHIsfO7cthcKpshN+uJsWOprW2jz/v/6rB/ O9mRcrFAnzpRHfvW4hRdzaKur+ZKb5SaMxVslG698bx31yS2z5EIy6+h5WVbBL7flBck R5yA== 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:in-reply-to :references; bh=8nyopd9bhVEiwPv+6DxY9goTdc8HOY1RZzwMkKpTo0A=; b=MDNpdNduFmgCbfr1qvWkSjfQVsIYkQXtqMzrZtT2TiksrDVGlEF3JpuhXNyr6X779o bIH1QJI+9XggFn/rmaoEGuH7KkZFGPwalafz3pmW7H9StGLD2AZD1+1ry9WxiwtEr6sB Z7bG9DLBH9EZkr7tnjMl3epszBetuDhnPQSMqRgriNyV46JkR2kRPp/CQ6WHxFHSIYxS 1veLCOAYIr5ZYNLj7U/MGYtWEJRA6emzokEiQx5a1blZWjCaL0q3UjCkkAN7pxxatPKb aEE0a/K7kkVh6s6tCP3UVWWQUnq3ZR+xRNZcICdaOuh8UrM/eQrHnrgt6TkFXbtDsXn7 5VGA== X-Gm-Message-State: AA6/9RlBvAnAypNVJnRUpw0e4Y7j/Q0tTIBtUgf6LqnvIR3+NoAAnpvd6Wt4cay/9ZEYEA== X-Received: by 10.66.246.13 with SMTP id xs13mr45934973pac.57.1476023670821; Sun, 09 Oct 2016 07:34:30 -0700 (PDT) Received: from localhost.localdomain ([103.51.74.65]) by smtp.gmail.com with ESMTPSA id n85sm27497582pfb.31.2016.10.09.07.34.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 09 Oct 2016 07:34:30 -0700 (PDT) From: Anand Moon To: Alan Stern , Greg Kroah-Hartman , Kukjin Kim , Krzysztof Kozlowski , Javier Martinez Canillas Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Anand Moon Subject: [PATCH 2/2] host: ohci-exynos: Convert to use the SET_SYSTEM_SLEEP_PM_OPS Date: Sun, 9 Oct 2016 14:34:15 +0000 Message-Id: <1476023655-3232-2-git-send-email-linux.amoon@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476023655-3232-1-git-send-email-linux.amoon@gmail.com> References: <1476023655-3232-1-git-send-email-linux.amoon@gmail.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the ohci-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/ohci-exynos.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 2cd105b..1764baa 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -219,7 +219,7 @@ static void exynos_ohci_shutdown(struct platform_device *pdev) hcd->driver->shutdown(hcd); } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int exynos_ohci_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); @@ -256,18 +256,16 @@ static int exynos_ohci_resume(struct device *dev) return 0; } -#else -#define exynos_ohci_suspend NULL -#define exynos_ohci_resume NULL -#endif -static const struct ohci_driver_overrides exynos_overrides __initconst = { - .extra_priv_size = sizeof(struct exynos_ohci_hcd), +static const struct dev_pm_ops exynos_ohci_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(exynos_ohci_suspend, exynos_ohci_resume) }; +#endif /* CONFIG_PM_SLEEP */ -static const struct dev_pm_ops exynos_ohci_pm_ops = { - .suspend = exynos_ohci_suspend, - .resume = exynos_ohci_resume, +#define DEV_PM_OPS IS_ENABLED(CONFIG_PM_SLEEP) ? &exynos_ohci_pm_ops : NULL + +static const struct ohci_driver_overrides exynos_overrides __initconst = { + .extra_priv_size = sizeof(struct exynos_ohci_hcd), }; #ifdef CONFIG_OF @@ -285,7 +283,7 @@ static struct platform_driver exynos_ohci_driver = { .shutdown = exynos_ohci_shutdown, .driver = { .name = "exynos-ohci", - .pm = &exynos_ohci_pm_ops, + .pm = DEV_PM_OPS, .of_match_table = of_match_ptr(exynos_ohci_match), } };