From patchwork Wed Jul 27 11:31:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 72855 Delivered-To: patches@linaro.org Received: by 10.140.29.52 with SMTP id a49csp251251qga; Wed, 27 Jul 2016 04:32:18 -0700 (PDT) X-Received: by 10.46.1.224 with SMTP id f93mr10981722lji.44.1469619136299; Wed, 27 Jul 2016 04:32:16 -0700 (PDT) Return-Path: Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com. [2a00:1450:4010:c07::230]) by mx.google.com with ESMTPS id 206si2969670lff.98.2016.07.27.04.32.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jul 2016 04:32:16 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::230 as permitted sender) client-ip=2a00:1450:4010:c07::230; 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::230 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x230.google.com with SMTP id l69so25158165lfg.1 for ; Wed, 27 Jul 2016 04:32:16 -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=WbwRuT2TV7x8MjMlcAJXm/43DqA0vp1QtwQict5IvsM=; b=HobFbJggbjExNIuOcUUhiXbAylGkmfzcKZ20eNdyfmm4CxaaMMYRe2ITvjxoWf3unr kWj6AzdYthFmFlkTSbM4OatlOJA3tSHt7mZ630FdeT54/mT9oaxYScd72bkZ57WFwnzB GszIP7eVocRto8dFmnzVAzlkFE2WpjMZZxFnk= 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=WbwRuT2TV7x8MjMlcAJXm/43DqA0vp1QtwQict5IvsM=; b=JQLgmiRSyg+5Ov+CxGIQuf1CyaS54Ablh5rZUrpUWiS7QbJgPpWWTjgn+Xe5YHq2tb RdO5PfmlGErzQD1Ib7Ir7aGnXUlsWqj69dS0GipNBHRAMozoB5i+VXbZ9lQWXGauDQO0 7s5lDykYTasvLBuVuAVidqPSkw1lVed5RHG6YagEuwsJvo8KarheEmhOafMKeltOMO+Z 2c025N201sEJr5VwZYdPU7RCZ78I4+mldFfTaTHGUD5OPjgJnycuBCwELE6fFIJHIemU aBNBIheSNiseWmnIuP3OnnmVmuTDMJSmUF+fTDZ2VHbnk7u5Eh0rDzlgPLf6W4kDSmka +DmA== X-Gm-Message-State: AEkoousdiuClhAABf1ekAcV9xgjRYN9borUtQnsEXSDO7/xwCNAoemXMxnLB8NcYrD442Sm7v2I= X-Received: by 10.25.82.9 with SMTP id g9mr11312746lfb.228.1469619135951; Wed, 27 Jul 2016 04:32:15 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jul 2016 04:32:14 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter Cc: Arnd Bergmann Subject: [PATCH 03/11] mmc: sdhci-of-esdhc: Simplify code by using SIMPLE_DEV_PM_OPS Date: Wed, 27 Jul 2016 13:31:59 +0200 Message-Id: <1469619127-29283-4-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> Let's use the SIMPLE_DEV_PM_OPS macro when declaring/assigning the system PM callbacks, as the code gets simplified. Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci-of-esdhc.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index 3f34d35..239be2f 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -481,7 +481,7 @@ static void esdhc_reset(struct sdhci_host *host, u8 mask) sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static u32 esdhc_proctl; static int esdhc_of_suspend(struct device *dev) { @@ -504,16 +504,12 @@ static int esdhc_of_resume(struct device *dev) } return ret; } - -static const struct dev_pm_ops esdhc_pmops = { - .suspend = esdhc_of_suspend, - .resume = esdhc_of_resume, -}; -#define ESDHC_PMOPS (&esdhc_pmops) -#else -#define ESDHC_PMOPS NULL #endif +static SIMPLE_DEV_PM_OPS(esdhc_of_dev_pm_ops, + esdhc_of_suspend, + esdhc_of_resume); + static const struct sdhci_ops sdhci_esdhc_be_ops = { .read_l = esdhc_be_readl, .read_w = esdhc_be_readw, @@ -657,7 +653,7 @@ static struct platform_driver sdhci_esdhc_driver = { .driver = { .name = "sdhci-esdhc", .of_match_table = sdhci_esdhc_of_match, - .pm = ESDHC_PMOPS, + .pm = &esdhc_of_dev_pm_ops, }, .probe = sdhci_esdhc_probe, .remove = sdhci_pltfm_unregister,