From patchwork Thu Dec 16 18:08:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 75784 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-ww0-f56.google.com (mail-ww0-f56.google.com [74.125.82.56]) by ozlabs.org (Postfix) with ESMTP id 69D65B7080 for ; Fri, 17 Dec 2010 05:08:36 +1100 (EST) Received: by wwi14 with SMTP id 14sf1933535wwi.11 for ; Thu, 16 Dec 2010 10:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:mime-version:x-beenthere:received :received:received:received:received-spf:received:received:received :from:to:cc:cc:cc:subject:message-id:date:x-cloudmark-analysis :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe:content-type; bh=IldfYb41vYk9arS5DLYVoWPfXo6gtxyJ+mVljfALMXo=; b=nXOGq7B2kLX20TzSJyQtfCmT5kQpSkVXGuefeugRp1dxNevVK9B0F4AbfzCY+CH3k5 6BaUShZtQi/TnbVBjNfVv+v+5eZZg4g27Jn7BXkoZnp0+VDyfN8a4/RamgFT1Vm4srFK mf6xPVdIjOACKsJs0FOaIzX0I4TSvBjT+gM7w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=mime-version:x-beenthere:received-spf:from:to:cc:subject:message-id :date:x-cloudmark-analysis:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; b=FJvQZ8p+nM45g8t1KLkwfoHiUJbe5lesbs5VvSTXcuNODCfYa6ofOWbnk3IYs0GmKL wi2wpE0rQgOkjsU9ljh818mVCjcbiB03QH//6SfnZ8nqVhjB2Ik1ZhtEQXs5DtF8FATL aZX7rSDLqggrts9QnyuRRp7R5awTgL8FKPktc= Received: by 10.216.161.130 with SMTP id w2mr1169787wek.13.1292522913310; Thu, 16 Dec 2010 10:08:33 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.227.6.216 with SMTP id a24ls231246wba.2.p; Thu, 16 Dec 2010 10:08:32 -0800 (PST) Received: by 10.216.20.213 with SMTP id p63mr159760wep.13.1292522912614; Thu, 16 Dec 2010 10:08:32 -0800 (PST) Received: by 10.216.20.213 with SMTP id p63mr159759wep.13.1292522912536; Thu, 16 Dec 2010 10:08:32 -0800 (PST) Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by gmr-mx.google.com with ESMTP id k2si39462wbc.3.2010.12.16.10.08.32; Thu, 16 Dec 2010 10:08:32 -0800 (PST) Received-SPF: neutral (google.com: 81.103.221.49 is neither permitted nor denied by best guess record for domain of dsd@laptop.org) client-ip=81.103.221.49; Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20101216180831.NZQK23441.mtaout03-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com>; Thu, 16 Dec 2010 18:08:31 +0000 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20101216180831.WRQQ28282.aamtaout03-winn.ispmail.ntl.com@zog.reactivated.net>; Thu, 16 Dec 2010 18:08:31 +0000 Received: by zog.reactivated.net (Postfix, from userid 1000) id A8E5A9D401B; Thu, 16 Dec 2010 18:08:29 +0000 (GMT) From: Daniel Drake To: a.zummo@towertech.it Cc: rtc-linux@googlegroups.com Cc: linux-kernel@vger.kernel.org Cc: pgf@laptop.org Subject: [rtc-linux] [PATCH] rtc-cmos: fix suspend/resume Message-Id: <20101216180829.A8E5A9D401B@zog.reactivated.net> Date: Thu, 16 Dec 2010 18:08:29 +0000 (GMT) X-Cloudmark-Analysis: v=1.1 cv=JvdXmxIgLJv2/GthKqHpGJEEHukvLcvELVXUanXFreg= c=1 sm=0 a=N00zUG7RsDsA:10 a=Op-mwl0xAAAA:8 a=aTbJtRG3W_R0jQmJmKUA:9 a=olpSOCNL1VO9LjGkqqIA:7 a=upEVNRLOtsVm0lwHnE6m8d4Hk-cA:4 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-Original-Sender: dsd@laptop.org X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 81.103.221.49 is neither permitted nor denied by best guess record for domain of dsd@laptop.org) smtp.mail=dsd@laptop.org Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , From: Paul Fox rtc-cmos was setting suspend/resume hooks at the device_driver level. However, the platform bus code (drivers/base/platform.c) only looks for resume hooks at the dev_pm_ops level, or within the platform_driver. Switch rtc_cmos to use dev_pm_ops so that suspend/resume code is executed again. Signed-off-by: Paul Fox Signed-off-by: Daniel Drake --- drivers/rtc/rtc-cmos.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 5856167..dfa5547 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -850,7 +850,7 @@ static void __exit cmos_do_remove(struct device *dev) #ifdef CONFIG_PM -static int cmos_suspend(struct device *dev, pm_message_t mesg) +static int cmos_suspend(struct device *dev) { struct cmos_rtc *cmos = dev_get_drvdata(dev); unsigned char tmp; @@ -898,7 +898,7 @@ static int cmos_suspend(struct device *dev, pm_message_t mesg) */ static inline int cmos_poweroff(struct device *dev) { - return cmos_suspend(dev, PMSG_HIBERNATE); + return cmos_suspend(dev); } static int cmos_resume(struct device *dev) @@ -1077,7 +1077,7 @@ static void __exit cmos_pnp_remove(struct pnp_dev *pnp) static int cmos_pnp_suspend(struct pnp_dev *pnp, pm_message_t mesg) { - return cmos_suspend(&pnp->dev, mesg); + return cmos_suspend(&pnp->dev); } static int cmos_pnp_resume(struct pnp_dev *pnp) @@ -1152,13 +1152,17 @@ static void cmos_platform_shutdown(struct platform_device *pdev) /* work with hotplug and coldplug */ MODULE_ALIAS("platform:rtc_cmos"); +static struct dev_pm_ops cmos_pm_ops = { + .suspend = cmos_suspend, + .resume = cmos_resume, +}; + static struct platform_driver cmos_platform_driver = { .remove = __exit_p(cmos_platform_remove), .shutdown = cmos_platform_shutdown, .driver = { .name = (char *) driver_name, - .suspend = cmos_suspend, - .resume = cmos_resume, + .pm = &cmos_pm_ops, } };