From patchwork Wed Jul 7 20:28:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 110695 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o67KSduw013714 for ; Wed, 7 Jul 2010 20:28:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751377Ab0GGU2i (ORCPT ); Wed, 7 Jul 2010 16:28:38 -0400 Received: from mail.gmx.net ([213.165.64.20]:42470 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750784Ab0GGU2i (ORCPT ); Wed, 7 Jul 2010 16:28:38 -0400 Received: (qmail invoked by alias); 07 Jul 2010 20:28:35 -0000 Received: from p57BD0C8B.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.12.139] by mail.gmx.net (mp042) with SMTP; 07 Jul 2010 22:28:35 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1+YmkxcLmyY7j/tsmwg2zj2GWjLcmd7ftvkCZyssV BKqEw8dNturt8P Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1OWbEQ-0006Of-1U; Wed, 07 Jul 2010 22:28:34 +0200 Date: Wed, 7 Jul 2010 22:28:34 +0200 (CEST) From: Guennadi Liakhovetski To: Magnus Damm cc: linux-sh@vger.kernel.org, lethal@linux-sh.org Subject: Re: [PATCH] ARM: mach-shmobile: Runtime PM prototype In-Reply-To: <20100705092122.22936.76406.sendpatchset@t400s> Message-ID: References: <20100705092122.22936.76406.sendpatchset@t400s> MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 07 Jul 2010 20:28:40 +0000 (UTC) diff --git a/arch/arm/mach-shmobile/pm_runtime.c b/arch/arm/mach-shmobile/pm_runtime.c index 93950dc..4036269 100644 --- a/arch/arm/mach-shmobile/pm_runtime.c +++ b/arch/arm/mach-shmobile/pm_runtime.c @@ -40,20 +40,27 @@ static void platform_pm_init_bug(struct platform_device *pdev) int platform_pm_runtime_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); + int ret; dev_dbg(dev, "platform_pm_runtime_suspend()\n"); platform_pm_init_bug(pdev); + if (dev->driver && dev->driver->pm && dev->driver->pm->runtime_suspend) + ret = dev->driver->pm->runtime_suspend(dev); + else + ret = 0; + if (pdev->archdata.clk) clk_disable(pdev->archdata.clk); - return 0; + return ret; } int platform_pm_runtime_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); + int ret; dev_dbg(dev, "platform_pm_runtime_resume()\n"); @@ -62,7 +69,12 @@ int platform_pm_runtime_resume(struct device *dev) if (pdev->archdata.clk) clk_enable(pdev->archdata.clk); - return 0; + if (dev->driver && dev->driver->pm && dev->driver->pm->runtime_resume) + ret = dev->driver->pm->runtime_resume(dev); + else + ret = 0; + + return ret; } int platform_pm_runtime_idle(struct device *dev)