From patchwork Wed Jul 27 11:32:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 72862 Delivered-To: patches@linaro.org Received: by 10.140.29.52 with SMTP id a49csp251512qga; Wed, 27 Jul 2016 04:32:52 -0700 (PDT) X-Received: by 10.25.161.12 with SMTP id k12mr9803474lfe.22.1469619148117; Wed, 27 Jul 2016 04:32:28 -0700 (PDT) Return-Path: Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com. [2a00:1450:4010:c07::232]) by mx.google.com with ESMTPS id e15si2968252lfb.116.2016.07.27.04.32.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jul 2016 04:32:28 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::232 as permitted sender) client-ip=2a00:1450:4010:c07::232; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::232 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x232.google.com with SMTP id b199so25209311lfe.0 for ; Wed, 27 Jul 2016 04:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aWA+v2egUNgc4ktvHx9XXJuHGakRj/eTU77Rvw8/D/s=; b=kFOIcg8GtnXVCk2kCLGZEbhELU+/a6mk5oqKSRnC4ZYzEGiqeDVxllYctxCqmoMFkL 0NEYIhFBbXxmeOAqXO4+jRpSy5FvDI0YaNJnqE/XbvLTbLDT4PUjMZk8Na5XvknC0BnM 3dOynWJJ1l1vh5K4EBa9eQ5/dch79k2HR42mk= 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=aWA+v2egUNgc4ktvHx9XXJuHGakRj/eTU77Rvw8/D/s=; b=l34RRU7KgSOvK+HErJs56PEr+txt2jMyMhVqR6pPkQmawHjC0O6D6YN4yA35RgC80L je6+UR5niRvihvjCuorvgv3YaNFda29hV03WOPnLmqk+5/Dqn5mY9/eEI/M4CqW82Wiv rEWdCvY44Sts/bpwnsuLn3Xegu0dyhL0wv6/4ZsYTuoXZ38QBVzlfCJ9ClkW/XtmnLZt xtLM3w6XHuNdEjdnZGZZNszrUfxe7ehdbNtNe0c2YsIV/aHWVgyAk+3qCNntNakAc1eh AwGH4kGA63gvnIqmqk6ivlKUqtnlkRhONloOdm9eHFFt77hTeQ3V2ajy03ODeB2/Y22U mdCQ== X-Gm-Message-State: AEkoouu5YBWolBuco5yB6Ve2kpI3K2SsLy3anPTidBmvTIQpVy8ykEclqYPPvMmO1YekbV+l8X4= X-Received: by 10.25.150.141 with SMTP id y135mr10146002lfd.66.1469619147776; Wed, 27 Jul 2016 04:32:27 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-128-67.na.cust.bahnhof.se. [155.4.128.67]) by smtp.gmail.com with ESMTPSA id h62sm911164lji.28.2016.07.27.04.32.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jul 2016 04:32:26 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter Cc: Arnd Bergmann Subject: [PATCH 10/11] mmc: sdhci-pltfm: Convert to use the SET_SYSTEM_SLEEP_PM_OPS Date: Wed, 27 Jul 2016 13:32:06 +0200 Message-Id: <1469619127-29283-11-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469619127-29283-1-git-send-email-ulf.hansson@linaro.org> References: <1469619127-29283-1-git-send-email-ulf.hansson@linaro.org> Move the 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. Within this context it also makes sense to move the declaration of the struct sdhci_pltfm_pmops, outside the #ifdef CONFIG_PM as the SET_SYSTEM_SLEEP_PM_OPS deals with this. This further simplifies the code. Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci-pltfm.c | 7 +++---- drivers/mmc/host/sdhci-pltfm.h | 4 ---- 2 files changed, 3 insertions(+), 8 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 7b1aacc..1d17dcf 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -215,7 +215,7 @@ int sdhci_pltfm_unregister(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister); -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int sdhci_pltfm_suspend(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); @@ -229,13 +229,12 @@ static int sdhci_pltfm_resume(struct device *dev) return sdhci_resume_host(host); } +#endif const struct dev_pm_ops sdhci_pltfm_pmops = { - .suspend = sdhci_pltfm_suspend, - .resume = sdhci_pltfm_resume, + SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_pltfm_resume) }; EXPORT_SYMBOL_GPL(sdhci_pltfm_pmops); -#endif /* CONFIG_PM */ static int __init sdhci_pltfm_drv_init(void) { diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h index 6c99210..0883a2a 100644 --- a/drivers/mmc/host/sdhci-pltfm.h +++ b/drivers/mmc/host/sdhci-pltfm.h @@ -109,11 +109,7 @@ static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host) return (void *)host->private; } -#ifdef CONFIG_PM extern const struct dev_pm_ops sdhci_pltfm_pmops; #define SDHCI_PLTFM_PMOPS (&sdhci_pltfm_pmops) -#else -#define SDHCI_PLTFM_PMOPS NULL -#endif #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */