From patchwork Tue Nov 5 12:10:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 21332 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1964D25E12 for ; Tue, 5 Nov 2013 12:10:16 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id v10sf14580355pde.5 for ; Tue, 05 Nov 2013 04:10:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Y7tokUgomyCVaYvMj7bnixMQz1GiglptE1Yere5UciA=; b=jge/3cNOMrrS1YyqpW1Ai/nVM32FfngqPDNXu90KnYtYUNmCNZIAgFudTetf0By4Wv Xdo+Uuc5QMF0d6LBrj1eEBThsg5znl4tj3RQ1CTDlqLvKSO0112I6m8O/lTCpLLpf81T yLeMcQ1Uk5Qd82XzgF980MhaMWe2QvcQGWL2g+kFUNB84o6940JQg/EcqGp6IUZg/Vd0 v6niMorzPstJt45xH2Q+c+fQQ4yk4ozye+uc2Gpf4EcE7294THJ2iF8HFYWquLk5o74e SWB//+jcqGEJMQ84PWjZRJ+X7QOsl/Y2IrcH6RWZb0rXZKNrLPdjTzgwIyA/4UfztlEk 6b4g== X-Gm-Message-State: ALoCoQmGSVV3We8x4Y5+89wdvgs8XJVhHinRLcqrvCD2fHRKfboHiDhSDKkc5yVGKIh2FCKfEa+s X-Received: by 10.66.102.100 with SMTP id fn4mr1520pab.47.1383653415095; Tue, 05 Nov 2013 04:10:15 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.72.227 with SMTP id g3ls167678qev.57.gmail; Tue, 05 Nov 2013 04:10:14 -0800 (PST) X-Received: by 10.220.196.66 with SMTP id ef2mr15705411vcb.7.1383653414718; Tue, 05 Nov 2013 04:10:14 -0800 (PST) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id tb3si5051940veb.130.2013.11.05.04.10.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Nov 2013 04:10:14 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id if17so5568524vcb.13 for ; Tue, 05 Nov 2013 04:10:14 -0800 (PST) X-Received: by 10.58.161.231 with SMTP id xv7mr15428729veb.2.1383653414620; Tue, 05 Nov 2013 04:10:14 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp202050vcz; Tue, 5 Nov 2013 04:10:14 -0800 (PST) X-Received: by 10.194.241.228 with SMTP id wl4mr17438132wjc.2.1383653413825; Tue, 05 Nov 2013 04:10:13 -0800 (PST) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by mx.google.com with ESMTPS id tm8si4393251wjc.127.2013.11.05.04.10.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Nov 2013 04:10:13 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.175 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.212.175; Received: by mail-wi0-f175.google.com with SMTP id hm4so1978604wib.2 for ; Tue, 05 Nov 2013 04:10:13 -0800 (PST) X-Received: by 10.180.80.163 with SMTP id s3mr16570787wix.51.1383653413155; Tue, 05 Nov 2013 04:10:13 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id e1sm13925599wij.6.2013.11.05.04.10.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Nov 2013 04:10:12 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball , Guennadi Liakhovetski , Ian Molton Cc: Ulf Hansson Subject: [PATCH 2/3] mmc: tmio_mmc: Convert from legacy to modern PM ops Date: Tue, 5 Nov 2013 13:10:02 +0100 Message-Id: <1383653403-10049-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1383653403-10049-1-git-send-email-ulf.hansson@linaro.org> References: <1383653403-10049-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Ulf Hansson --- drivers/mmc/host/tmio_mmc.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 8860d4d..a56a3fe 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -23,38 +23,39 @@ #include "tmio_mmc.h" -#ifdef CONFIG_PM -static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state) +#ifdef CONFIG_PM_SLEEP +static int tmio_mmc_suspend(struct device *dev) { - const struct mfd_cell *cell = mfd_get_cell(dev); + struct mmc_host *mmc = dev_get_drvdata(dev); + struct tmio_mmc_host *host = mmc_priv(mmc); + const struct mfd_cell *cell = mfd_get_cell(host->pdev); int ret; - ret = tmio_mmc_host_suspend(&dev->dev); + ret = tmio_mmc_host_suspend(dev); /* Tell MFD core it can disable us now.*/ if (!ret && cell->disable) - cell->disable(dev); + cell->disable(host->pdev); return ret; } -static int tmio_mmc_resume(struct platform_device *dev) +static int tmio_mmc_resume(struct device *dev) { - const struct mfd_cell *cell = mfd_get_cell(dev); + struct mmc_host *mmc = dev_get_drvdata(dev); + struct tmio_mmc_host *host = mmc_priv(mmc); + const struct mfd_cell *cell = mfd_get_cell(host->pdev); int ret = 0; /* Tell the MFD core we are ready to be enabled */ if (cell->resume) - ret = cell->resume(dev); + ret = cell->resume(host->pdev); if (!ret) - ret = tmio_mmc_host_resume(&dev->dev); + ret = tmio_mmc_host_resume(dev); return ret; } -#else -#define tmio_mmc_suspend NULL -#define tmio_mmc_resume NULL #endif static int tmio_mmc_probe(struct platform_device *pdev) @@ -125,15 +126,18 @@ static int tmio_mmc_remove(struct platform_device *pdev) /* ------------------- device registration ----------------------- */ +static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume) +}; + static struct platform_driver tmio_mmc_driver = { .driver = { .name = "tmio-mmc", .owner = THIS_MODULE, + .pm = &tmio_mmc_dev_pm_ops, }, .probe = tmio_mmc_probe, .remove = tmio_mmc_remove, - .suspend = tmio_mmc_suspend, - .resume = tmio_mmc_resume, }; module_platform_driver(tmio_mmc_driver);