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: 9249703 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 044366077C for ; Wed, 27 Jul 2016 11:32:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAFDD27AC2 for ; Wed, 27 Jul 2016 11:32:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF20A27C2C; Wed, 27 Jul 2016 11:32:19 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 D8E0427AC2 for ; Wed, 27 Jul 2016 11:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755722AbcG0LcS (ORCPT ); Wed, 27 Jul 2016 07:32:18 -0400 Received: from mail-lf0-f47.google.com ([209.85.215.47]:33545 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755676AbcG0LcR (ORCPT ); Wed, 27 Jul 2016 07:32:17 -0400 Received: by mail-lf0-f47.google.com with SMTP id b199so25205773lfe.0 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=YUqJ5ikCl77qgnPvKqQfVTv7n7ocy1t+zVn+OuiLZ3OIRRr242rEbfVhsdxvpn9Atf p5KMDdYJieCNvcoJh6EaQZ+ilPGT6c7RB6gfM3klxo+1xSi5l4BUzITRS97leogGNxWz gPWXJUgAz0qDUsaTnTZCSkSxCDHNIFs3Mwv7Gmm6vG8cEVXKtq9d3m+n9WJrb0wy53BU XMQJdEoaFIliLa+AnMTfTcLOpdS1q6kGZHV3eddGJN/cmyNzeH65e1dVNoQN53KkfgF2 Ki+XMLSYcIoH2n70XfImnxbKekXtCPuti07ODkRGzjMJ5otner/Dpd4CBDAd8nP9AR4x Vb9Q== X-Gm-Message-State: AEkoousBp9GyX5mcjibN0PprVexHJzITC97YOVQ9a1G2QFRBNkHCVBuvEo76reXK3pn/+8wk X-Received: by 10.25.82.9 with SMTP id g9mr11312746lfb.228.1469619135951; Wed, 27 Jul 2016 04:32:15 -0700 (PDT) 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> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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,