From patchwork Fri Sep 18 19:41:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 48604 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 n8IJhLh0004221 for ; Fri, 18 Sep 2009 19:43:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756250AbZIRTmj (ORCPT ); Fri, 18 Sep 2009 15:42:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751782AbZIRTmj (ORCPT ); Fri, 18 Sep 2009 15:42:39 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:47491 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757996AbZIRTmh (ORCPT ); Fri, 18 Sep 2009 15:42:37 -0400 Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id n8IJf7vR007323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Sep 2009 12:41:08 -0700 Received: from localhost.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id n8IJf666002441; Fri, 18 Sep 2009 12:41:06 -0700 Message-Id: <200909181941.n8IJf666002441@imap1.linux-foundation.org> Subject: [patch 3/8] acerhdf: convert to dev_pm_ops To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, akpm@linux-foundation.org, petkovbb@gmail.com, andi@lisas.de, dtor@mail.ru, peter@piie.net From: akpm@linux-foundation.org Date: Fri, 18 Sep 2009 12:41:05 -0700 MIME-Version: 1.0 X-Spam-Status: No, hits=-3.513 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Borislav Petkov Signed-off-by: Borislav Petkov Signed-off-by: Peter Feuerer Cc: Andreas Mohr Cc: Len Brown Cc: Dmitry Torokhov Signed-off-by: Andrew Morton --- drivers/platform/x86/acerhdf.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff -puN drivers/platform/x86/acerhdf.c~acerhdf-convert-to-dev_pm_ops drivers/platform/x86/acerhdf.c --- a/drivers/platform/x86/acerhdf.c~acerhdf-convert-to-dev_pm_ops +++ a/drivers/platform/x86/acerhdf.c @@ -52,7 +52,7 @@ */ #undef START_IN_KERNEL_MODE -#define DRV_VER "0.5.16" +#define DRV_VER "0.5.17" /* * According to the Atom N270 datasheet, @@ -435,7 +435,7 @@ struct thermal_cooling_device_ops acerhd }; /* suspend / resume functionality */ -static int acerhdf_suspend(struct platform_device *dev, pm_message_t state) +static int acerhdf_suspend(struct device *dev) { if (kernelmode) acerhdf_change_fanstate(ACERHDF_FAN_AUTO); @@ -446,14 +446,6 @@ static int acerhdf_suspend(struct platfo return 0; } -static int acerhdf_resume(struct platform_device *device) -{ - if (verbose) - pr_notice("resuming\n"); - - return 0; -} - static int __devinit acerhdf_probe(struct platform_device *device) { return 0; @@ -464,15 +456,19 @@ static int acerhdf_remove(struct platfor return 0; } +static struct dev_pm_ops acerhdf_pm_ops = { + .suspend = acerhdf_suspend, + .freeze = acerhdf_suspend, +}; + static struct platform_driver acerhdf_driver = { .driver = { - .name = "acerhdf", + .name = "acerhdf", .owner = THIS_MODULE, + .pm = &acerhdf_pm_ops, }, .probe = acerhdf_probe, .remove = acerhdf_remove, - .suspend = acerhdf_suspend, - .resume = acerhdf_resume, };