From patchwork Thu Apr 7 00:02:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 691461 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3704DZk027237 for ; Thu, 7 Apr 2011 00:04:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757142Ab1DGACs (ORCPT ); Wed, 6 Apr 2011 20:02:48 -0400 Received: from na3sys009aog104.obsmtp.com ([74.125.149.73]:58950 "EHLO na3sys009aog104.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754092Ab1DGACo (ORCPT ); Wed, 6 Apr 2011 20:02:44 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]) (using TLSv1) by na3sys009aob104.postini.com ([74.125.148.12]) with SMTP ID DSNKTZz/I+WEgNiRfpKF6cFK+k56obBnL7g/@postini.com; Wed, 06 Apr 2011 17:02:44 PDT Received: by mail-gy0-f174.google.com with SMTP id 10so958942gyd.5 for ; Wed, 06 Apr 2011 17:02:43 -0700 (PDT) Received: by 10.150.170.6 with SMTP id s6mr209797ybe.305.1302134562902; Wed, 06 Apr 2011 17:02:42 -0700 (PDT) Received: from localhost (c-24-18-179-55.hsd1.wa.comcast.net [24.18.179.55]) by mx.google.com with ESMTPS id o2sm956833ybn.6.2011.04.06.17.02.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Apr 2011 17:02:42 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-sh@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Magnus Damm , "Rafael J. Wysocki" , Grant Likely , Greg Kroah-Hartman , Magnus Damm , Paul Mundt Subject: [PATCH/RFC 1/6] ARM: sh-mobile: runtime PM: convert to device powerdomains Date: Wed, 6 Apr 2011 17:02:44 -0700 Message-Id: <1302134569-22825-2-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1302134569-22825-1-git-send-email-khilman@ti.com> References: <1302134569-22825-1-git-send-email-khilman@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 07 Apr 2011 00:04:13 +0000 (UTC) Remove the deprecated use of weak platform_bus symbols in favor of using the new device power domains. Cc: Magnus Damm Cc: Paul Mundt Signed-off-by: Kevin Hilman --- arch/arm/mach-shmobile/pm_runtime.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-shmobile/pm_runtime.c b/arch/arm/mach-shmobile/pm_runtime.c index 94912d3..6c75c3f 100644 --- a/arch/arm/mach-shmobile/pm_runtime.c +++ b/arch/arm/mach-shmobile/pm_runtime.c @@ -66,7 +66,7 @@ static void platform_pm_runtime_bug(struct device *dev, dev_err(dev, "runtime pm suspend before resume\n"); } -int platform_pm_runtime_suspend(struct device *dev) +static int platform_pm_runtime_suspend(struct device *dev) { struct pm_runtime_data *prd = __to_prd(dev); @@ -82,7 +82,7 @@ int platform_pm_runtime_suspend(struct device *dev) return 0; } -int platform_pm_runtime_resume(struct device *dev) +static int platform_pm_runtime_resume(struct device *dev) { struct pm_runtime_data *prd = __to_prd(dev); @@ -98,12 +98,20 @@ int platform_pm_runtime_resume(struct device *dev) return 0; } -int platform_pm_runtime_idle(struct device *dev) +static int platform_pm_runtime_idle(struct device *dev) { /* suspend synchronously to disable clocks immediately */ return pm_runtime_suspend(dev); } +static struct dev_power_domain platform_pm_power_domain = { + .ops = { + .runtime_suspend = platform_pm_runtime_suspend, + .runtime_resume = platform_pm_runtime_resume, + .runtime_idle = platform_pm_runtime_idle, + }, +}; + static int platform_bus_notify(struct notifier_block *nb, unsigned long action, void *data) { @@ -114,10 +122,12 @@ static int platform_bus_notify(struct notifier_block *nb, if (action == BUS_NOTIFY_BIND_DRIVER) { prd = devres_alloc(__devres_release, sizeof(*prd), GFP_KERNEL); - if (prd) + if (prd) { devres_add(dev, prd); - else + dev->pwr_domain = &platform_pm_power_domain; + } else { dev_err(dev, "unable to alloc memory for runtime pm\n"); + } } return 0;