From patchwork Fri Nov 8 06:06:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 21416 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BCD42244F2 for ; Fri, 8 Nov 2013 06:06:27 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id x19sf2357048qcw.4 for ; Thu, 07 Nov 2013 22:06:27 -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=Xxt7CJ7HY5pqIYhBccbhB0t2ukjABsS2RXFNMDBdqVI=; b=fzqZlyo/qFQbDl63q3Fhz6ftFPlGUgd2nt2sOPIWF35Qk5BymVba+AK/uRuvUCI4C+ cP/DIOiPq3jdP0hjo7TJcjvkMUovG6+uHOwsUz26cXyTRTIuEqKPQnw1PucfA2cXt3ir 1r3FjUTpN/swZoCRiLjNfg2m0PC+lVOv0EVBs5gMvXBhV/kqlHCtfj10xB+sbCC5o8B6 milAoc5V1TR31o/QJcsGM2tN8K1TeIPjxIra9IZ6kOZaD/z7ybTl7Is4+5UG4/Xbj1uy rC74wvJdF61Zdy8D3sgC9NG9TcePg7N6HrCVtfF5C2LobNkJ49YNlzLUN+c6wGq6JpQx /c2A== X-Gm-Message-State: ALoCoQn/WBhNGwXbsQ/WnHtyMzOa1X2g1EqJ3xP55TF5p4duZaiNIn/by4qViUstSkTVf/WbCZq/ X-Received: by 10.52.69.198 with SMTP id g6mr4900408vdu.6.1383890787459; Thu, 07 Nov 2013 22:06:27 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.118.103 with SMTP id kl7ls1444455qeb.32.gmail; Thu, 07 Nov 2013 22:06:27 -0800 (PST) X-Received: by 10.220.47.10 with SMTP id l10mr216346vcf.32.1383890787365; Thu, 07 Nov 2013 22:06:27 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id uh5si3242501vcb.127.2013.11.07.22.06.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 22:06:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id oy12so1139902veb.11 for ; Thu, 07 Nov 2013 22:06:27 -0800 (PST) X-Received: by 10.52.34.76 with SMTP id x12mr244846vdi.35.1383890787264; Thu, 07 Nov 2013 22:06:27 -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 u4csp6959vcz; Thu, 7 Nov 2013 22:06:26 -0800 (PST) X-Received: by 10.112.77.169 with SMTP id t9mr9499176lbw.3.1383890786289; Thu, 07 Nov 2013 22:06:26 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by mx.google.com with ESMTPS id a8si2993212lbx.110.2013.11.07.22.06.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 22:06:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.217.173 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id w7so1112156lbi.18 for ; Thu, 07 Nov 2013 22:06:25 -0800 (PST) X-Received: by 10.152.37.169 with SMTP id z9mr9396251laj.5.1383890785537; Thu, 07 Nov 2013 22:06:25 -0800 (PST) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id f4sm6860209lah.0.2013.11.07.22.06.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Nov 2013 22:06:24 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: Ulf Hansson Subject: [PATCH 2/8] mmc: tmio_mmc: Convert from legacy to modern PM ops Date: Fri, 8 Nov 2013 07:06:10 +0100 Message-Id: <1383890776-6912-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1383890776-6912-1-git-send-email-ulf.hansson@linaro.org> References: <1383890776-6912-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.128.180 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 Acked-by: 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);