Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756951Ab2FWVTK (ORCPT ); Sat, 23 Jun 2012 17:19:10 -0400 Received: from ogre.sisk.pl ([193.178.161.156]:37003 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756721Ab2FWVSW (ORCPT ); Sat, 23 Jun 2012 17:18:22 -0400 From: "Rafael J. Wysocki" To: Linux PM list Subject: [PATCH 17/21] xo15-ebook: Use struct dev_pm_ops for power management Date: Sat, 23 Jun 2012 23:18:51 +0200 User-Agent: KMail/1.13.6 (Linux/3.5.0-rc3+; KDE/4.6.0; x86_64; ; ) Cc: ACPI Devel Mailing List , LKML , Len Brown , Matthew Garrett , platform-driver-x86@vger.kernel.org, Eric Piel , Mattia Dongili , Harald Welte References: <201206232306.06602.rjw@sisk.pl> In-Reply-To: <201206232306.06602.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201206232318.51901.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1546 Lines: 49 From: Rafael J. Wysocki Make the xo15-ebook driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct acpi_device_ops. Signed-off-by: Rafael J. Wysocki --- drivers/platform/x86/xo15-ebook.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) Index: linux/drivers/platform/x86/xo15-ebook.c =================================================================== --- linux.orig/drivers/platform/x86/xo15-ebook.c +++ linux/drivers/platform/x86/xo15-ebook.c @@ -77,11 +77,13 @@ static void ebook_switch_notify(struct a } } -static int ebook_switch_resume(struct acpi_device *device) +static int ebook_switch_resume(struct device *dev) { - return ebook_send_state(device); + return ebook_send_state(to_acpi_device(dev)); } +static SIMPLE_DEV_PM_OPS(ebook_switch_pm, NULL, ebook_switch_resume); + static int ebook_switch_add(struct acpi_device *device) { struct ebook_switch *button; @@ -161,10 +163,10 @@ static struct acpi_driver xo15_ebook_dri .ids = ebook_device_ids, .ops = { .add = ebook_switch_add, - .resume = ebook_switch_resume, .remove = ebook_switch_remove, .notify = ebook_switch_notify, }, + .drv.pm = &ebook_switch_pm, }; static int __init xo15_ebook_init(void) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/