From patchwork Wed Jul 27 11:31:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 72853 Delivered-To: patches@linaro.org Received: by 10.140.29.52 with SMTP id a49csp251210qga; Wed, 27 Jul 2016 04:32:13 -0700 (PDT) X-Received: by 10.25.29.6 with SMTP id d6mr11247649lfd.93.1469619133037; Wed, 27 Jul 2016 04:32:13 -0700 (PDT) Return-Path: Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com. [2a00:1450:4010:c07::22a]) by mx.google.com with ESMTPS id w197si2849578lfd.282.2016.07.27.04.32.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jul 2016 04:32:13 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22a as permitted sender) client-ip=2a00:1450:4010:c07::22a; 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::22a as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x22a.google.com with SMTP id g62so25072507lfe.3 for ; Wed, 27 Jul 2016 04:32:12 -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=CfJOgBApUFutYbKQ8sp7WJJz372JVWAkzuR8U67lgzA=; b=WvXy6wO9XMXaR5jCEXtKzp944R26GI1b3sHZVUAXFykJcInFkE1NN7DTNLW4wbYMFp BnUUj7ZAeRUQBl3o8Ym7wDQ1tEWyhVLRE8LnvufOD/4N7+OshQn7BadC8c9mGoShSsfr 6JDhHzCL+f85SstCMhW68oF1rWCKEkoz5LWJI= 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=CfJOgBApUFutYbKQ8sp7WJJz372JVWAkzuR8U67lgzA=; b=acAfnL25qrb58xwRRaTy9RStHA2p4wKqDVXwl3GQoYTof62/c7mge1Jka8s93OZCIT R1i/s8AmvtXZ/mPflJQmCgIO31uEN7zgl8IQQGB+79v3wcd+889vA2pfvKPrCHZBMGBH B4QumaZ7fVsMB69DTpQdgJItw9b+WYomrIH2o34t4AggcoVtY/w1yRmLknvANdfZpNfD HbF+kJnym9vc20ytLmzE8dVRW7QtvqqimIJZ2Qo7Eu29sgjWJlkyO/Po5VVUFLR3qY4c Hmy0lwxIDU1g7Ms3LoDYFROhveZzYASOrsHLLhX6tuqUpTNy4W6XBUd8vUAKgxQcTSJO LxGw== X-Gm-Message-State: AEkoousKINYqh3AERfwwYVeBtoPQNLecpBNx2cmmzBd5nV8DQsjxp4u+MfzOY9AitHSleU6KUUg= X-Received: by 10.25.37.18 with SMTP id l18mr11939133lfl.88.1469619132686; Wed, 27 Jul 2016 04:32:12 -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.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jul 2016 04:32:11 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter Cc: Arnd Bergmann Subject: [PATCH 01/11] mmc: sdhci-pci-core: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS Date: Wed, 27 Jul 2016 13:31:57 +0200 Message-Id: <1469619127-29283-2-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> Convert to define the system PM callbacks to be build for CONFIG_PM_SLEEP and use the SET_SYSTEM_SLEEP_PM_OPS. In this way the code becomes cleaner. Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci-pci-core.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index bdda3d0..897cfd2 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -1413,8 +1413,7 @@ static const struct sdhci_ops sdhci_pci_ops = { * * \*****************************************************************************/ -#ifdef CONFIG_PM - +#ifdef CONFIG_PM_SLEEP static int sdhci_pci_suspend(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); @@ -1496,7 +1495,9 @@ static int sdhci_pci_resume(struct device *dev) return 0; } +#endif +#ifdef CONFIG_PM static int sdhci_pci_runtime_suspend(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); @@ -1562,17 +1563,10 @@ static int sdhci_pci_runtime_resume(struct device *dev) return 0; } - -#else /* CONFIG_PM */ - -#define sdhci_pci_suspend NULL -#define sdhci_pci_resume NULL - -#endif /* CONFIG_PM */ +#endif static const struct dev_pm_ops sdhci_pci_pm_ops = { - .suspend = sdhci_pci_suspend, - .resume = sdhci_pci_resume, + SET_SYSTEM_SLEEP_PM_OPS(sdhci_pci_suspend, sdhci_pci_resume) SET_RUNTIME_PM_OPS(sdhci_pci_runtime_suspend, sdhci_pci_runtime_resume, NULL) };