From patchwork Thu Dec 3 12:31:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 64506 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB3CZ2QO014575 for ; Thu, 3 Dec 2009 12:37:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752374AbZLCMhM (ORCPT ); Thu, 3 Dec 2009 07:37:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752929AbZLCMhM (ORCPT ); Thu, 3 Dec 2009 07:37:12 -0500 Received: from mail-gx0-f226.google.com ([209.85.217.226]:57457 "EHLO mail-gx0-f226.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752374AbZLCMhL (ORCPT ); Thu, 3 Dec 2009 07:37:11 -0500 Received: by gxk26 with SMTP id 26so1167039gxk.1 for ; Thu, 03 Dec 2009 04:37:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=/ptnYDYoymT9L2rWh4WYZJNfMWNba7Lvh/weAc+zeaI=; b=D4iWoM7S01E2sHlof/MOg3dCaDvJ9/rNJyzezc/kZLkGRSC/mkaSb9jlhefYaBXsSP SEmCfjJnt/Zm+SaDZboh2J1juo8SdTUspKjz6zhAiI36dahJXgfFmjhLH5E1lYuPBGqR tiKIvdMm9ePsd78nBc1p+5PT+8QSq9yMeTwQw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=XnXGURG5IYaaHE2UGD6V2i7M1TcPbfqoo9eyCFi0IbjSf+XYUwnJk8563hb4cbfSQg hVOkk0Mlgr/oFHhpeH0EeBAIlRpDpnjcCz/1Us7l6+JSs6hKmAsSqVfR+MtTJBFXSM8M hcVlj5FYuMysq81KUCUtEfe49qI2HZ0k9ywhk= Received: by 10.150.87.2 with SMTP id k2mr2738863ybb.267.1259843837861; Thu, 03 Dec 2009 04:37:17 -0800 (PST) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 13sm1095719gxk.5.2009.12.03.04.37.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 03 Dec 2009 04:37:17 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org, broonie@opensource.wolfsonmicro.com Date: Thu, 03 Dec 2009 21:31:45 +0900 Message-Id: <20091203123145.9997.81575.sendpatchset@rxone.opensource.se> Subject: [PATCH] sh: allow runtime pm without suspend/resume callbacks Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org --- 0001/arch/sh/kernel/cpu/shmobile/pm_runtime.c +++ work/arch/sh/kernel/cpu/shmobile/pm_runtime.c 2009-12-02 12:17:25.000000000 +0900 @@ -45,12 +45,14 @@ static int __platform_pm_runtime_resume( dev_dbg(d, "__platform_pm_runtime_resume() [%d]\n", hwblk); - if (d->driver && d->driver->pm && d->driver->pm->runtime_resume) { + if (d->driver) { hwblk_enable(hwblk_info, hwblk); ret = 0; if (test_bit(PDEV_ARCHDATA_FLAG_SUSP, &ad->flags)) { - ret = d->driver->pm->runtime_resume(d); + if (d->driver->pm && d->driver->pm->runtime_resume) + ret = d->driver->pm->runtime_resume(d); + if (!ret) clear_bit(PDEV_ARCHDATA_FLAG_SUSP, &ad->flags); else @@ -73,12 +75,15 @@ static int __platform_pm_runtime_suspend dev_dbg(d, "__platform_pm_runtime_suspend() [%d]\n", hwblk); - if (d->driver && d->driver->pm && d->driver->pm->runtime_suspend) { + if (d->driver) { BUG_ON(!test_bit(PDEV_ARCHDATA_FLAG_IDLE, &ad->flags)); + ret = 0; - hwblk_enable(hwblk_info, hwblk); - ret = d->driver->pm->runtime_suspend(d); - hwblk_disable(hwblk_info, hwblk); + if (d->driver->pm && d->driver->pm->runtime_suspend) { + hwblk_enable(hwblk_info, hwblk); + ret = d->driver->pm->runtime_suspend(d); + hwblk_disable(hwblk_info, hwblk); + } if (!ret) { set_bit(PDEV_ARCHDATA_FLAG_SUSP, &ad->flags);