From patchwork Wed Nov 6 08:27:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 21346 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 295C125E16 for ; Wed, 6 Nov 2013 08:27:14 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id i3sf8621026vbh.2 for ; Wed, 06 Nov 2013 00:27:14 -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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=+4IOy3IbSlyEf/jnkRFNp1vN7FdPMO1YbEXXEf9pr/o=; b=d8PGF5KqueR0kEJ+Z1cosYy8+moWkS6uGFwI3DR2HUzar7cgD2abMYQDjVK0iLtjbk +QRd38kU+Vvs/BP+ltt9ymm1BAAEKicpA6adEePtlowKC4MWLfCmXinonxCNz9QsUD7w b0NiUTS+ymhFLfZJCcsxQnTmAQHpyOKb9x9/RvqUMkDjN78/htbnHPjFvZwF4Xb0VT5w MW/0GTtYJn2Sr0eK8klvqtj6/ICr+kCgriAzzf2CNIksNTvieStvlS1f0JXZZ8w+BaOq PoyT0I47N1iFPOwu0L4eNpSOU+DMhwGb+s0Y2kgXrXJ5CSNpNmb9YRcIBHxlscHIRaLn 1YQA== X-Gm-Message-State: ALoCoQnr+xJUfcM8uNSnneBaBIe5j3ksmknqb+ar7EV+Rm8LlJQTh3MMATh4DmnErRdDZm72YVxf X-Received: by 10.236.99.116 with SMTP id w80mr31009yhf.48.1383726434602; Wed, 06 Nov 2013 00:27:14 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.5.99 with SMTP id r3ls565014qer.88.gmail; Wed, 06 Nov 2013 00:27:14 -0800 (PST) X-Received: by 10.52.30.66 with SMTP id q2mr1222864vdh.18.1383726434462; Wed, 06 Nov 2013 00:27:14 -0800 (PST) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id bz3si8022048vcb.123.2013.11.06.00.27.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 00:27:14 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.51; Received: by mail-vb0-f51.google.com with SMTP id w5so3145918vbf.38 for ; Wed, 06 Nov 2013 00:27:14 -0800 (PST) X-Received: by 10.58.181.230 with SMTP id dz6mr1380430vec.35.1383726434383; Wed, 06 Nov 2013 00:27: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 u4csp267363vcz; Wed, 6 Nov 2013 00:27:13 -0800 (PST) X-Received: by 10.194.119.132 with SMTP id ku4mr757139wjb.51.1383726433333; Wed, 06 Nov 2013 00:27:13 -0800 (PST) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by mx.google.com with ESMTPS id x19si3562295wie.11.2013.11.06.00.27.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 00:27:13 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.171 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.212.171; Received: by mail-wi0-f171.google.com with SMTP id f4so3341196wiw.4 for ; Wed, 06 Nov 2013 00:27:12 -0800 (PST) X-Received: by 10.180.37.227 with SMTP id b3mr1458636wik.24.1383726432907; Wed, 06 Nov 2013 00:27:12 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id q3sm22327149wib.5.2013.11.06.00.27.11 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 00:27:12 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball , Guennadi Liakhovetski , Ian Molton Cc: Ulf Hansson Subject: [PATCH v2 2/3] mmc: tmio_mmc: Convert from legacy to modern PM ops Date: Wed, 6 Nov 2013 09:27:05 +0100 Message-Id: <1383726425-9836-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 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.212.51 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 --- Changes in v2: Adopted to review comments from Guennadi Liakhovetski. --- drivers/mmc/host/tmio_mmc.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 8860d4d..42da904 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -23,38 +23,37 @@ #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 platform_device *pdev = to_platform_device(dev); + const struct mfd_cell *cell = mfd_get_cell(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(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 platform_device *pdev = to_platform_device(dev); + const struct mfd_cell *cell = mfd_get_cell(pdev); int ret = 0; /* Tell the MFD core we are ready to be enabled */ if (cell->resume) - ret = cell->resume(dev); + ret = cell->resume(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 +124,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);