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: 9249699 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 E43E56077C for ; Wed, 27 Jul 2016 11:32:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5CCA271FD for ; Wed, 27 Jul 2016 11:32:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA11B27BF7; Wed, 27 Jul 2016 11:32:15 +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 6EF25271FD for ; Wed, 27 Jul 2016 11:32:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755690AbcG0LcO (ORCPT ); Wed, 27 Jul 2016 07:32:14 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:35861 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755676AbcG0LcO (ORCPT ); Wed, 27 Jul 2016 07:32:14 -0400 Received: by mail-lf0-f45.google.com with SMTP id g62so25072506lfe.3 for ; Wed, 27 Jul 2016 04:32:13 -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=QgnB/N0LnedgUqhKLm9QiXWDm+XTAb7FUX7RcM3GXuTJ/Oi+OHPVWQVqFmhqEybPTT uzQkeFJx74RjpL0zBYE44qtFKBiqTQKdrlZP5sDHOC5Ci5ayk9oJP1wyjD7GgHZp3CjB y8BfHRv1/RwUKo80OLsPp5XsliRBMaQ351X0QsjR5TsbhN4fUz81aO+EzMd7H8UpbrSk DVXajShGk2hWV0gVuy/dN+1DLmdvnk3cb9EYdohWflgAZBTBuOVtukeprTXy2d5N4MuW FAaG+Pdglh1te3dG8YVwIUvcyF/Q6RJE5HGWzXt40DnW5vkd3UZuwO6nObL/9fKudZKP ro8w== X-Gm-Message-State: AEkooutePDakTtUVXiVIF0saFMNZsOQMhjclH9nJIjI3bAvSnkI0yNVo/AKWJqFbSwdVDBlk X-Received: by 10.25.37.18 with SMTP id l18mr11939133lfl.88.1469619132686; Wed, 27 Jul 2016 04:32:12 -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.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> 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 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(-) 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) };