From patchwork Thu Dec 3 06:12:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 64421 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 nB36C6g9021138 for ; Thu, 3 Dec 2009 06:12:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751167AbZLCGL7 (ORCPT ); Thu, 3 Dec 2009 01:11:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751289AbZLCGL6 (ORCPT ); Thu, 3 Dec 2009 01:11:58 -0500 Received: from mail-pz0-f184.google.com ([209.85.222.184]:33434 "EHLO mail-pz0-f184.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751167AbZLCGL6 (ORCPT ); Thu, 3 Dec 2009 01:11:58 -0500 Received: by pzk14 with SMTP id 14so1020747pzk.23 for ; Wed, 02 Dec 2009 22:12:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=I9Rq4396I6GeJ9AAtMLCCn83MR0ky5gVu8TlS8uywqw=; b=a/I82/scH/oVzq2k9rlLmghJDewDS7Htn0/9GONZb5TINpaQLEPFtAYVou1IaXr7m0 RAzp1W/XCmHb7Bov/dpDaI/f1mJOyoPGALy0YeVxhF7n9OMTKtKnHdGGVy0OM88PYNCM 6sv49ClzBIVl6V1DZIwjBchBBAUuKOfPXVBWY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=XrCUiLAR66snfQP4vbscPBlC+VhwkgZNjtCRBoH68r1s+c/4+7ry2Ix2wpBC903dtk w23ocKnPKIM61NLMzkGuxiM9L0zAvmhNEi7zD0Zq2j4GSwE9mjt/FbfBkz0DpjKgae6g apWJzf70peS4gU0VYqlXF82UJjwlH+Qvu9MRc= Received: by 10.114.2.40 with SMTP id 40mr1902636wab.181.1259820724809; Wed, 02 Dec 2009 22:12:04 -0800 (PST) Received: from mailhub.coreip.homeip.net (c-24-6-153-137.hsd1.ca.comcast.net [24.6.153.137]) by mx.google.com with ESMTPS id 20sm1430672pzk.13.2009.12.02.22.12.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Dec 2009 22:12:04 -0800 (PST) Date: Wed, 2 Dec 2009 22:12:01 -0800 From: Dmitry Torokhov To: Linux Input Cc: linux-pm@lists.linux-foundation.org, "Rafael J. Wysocki" Subject: [PATCH] Input: matrix-keypad - switch to using dev_pm_ops Message-ID: <20091203061200.GG9121@core.coreip.homeip.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index a1152ba..d3c8b61 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -215,8 +215,9 @@ static void matrix_keypad_stop(struct input_dev *dev) } #ifdef CONFIG_PM -static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t state) +static int matrix_keypad_suspend(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct matrix_keypad *keypad = platform_get_drvdata(pdev); const struct matrix_keypad_platform_data *pdata = keypad->pdata; int i; @@ -237,8 +238,9 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat return 0; } -static int matrix_keypad_resume(struct platform_device *pdev) +static int matrix_keypad_resume(struct device *dev) { + struct platform_device *pdev = to_platform_device(dev); struct matrix_keypad *keypad = platform_get_drvdata(pdev); const struct matrix_keypad_platform_data *pdata = keypad->pdata; int i; @@ -257,9 +259,9 @@ static int matrix_keypad_resume(struct platform_device *pdev) return 0; } -#else -#define matrix_keypad_suspend NULL -#define matrix_keypad_resume NULL + +static const SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops, + matrix_keypad_suspend, matrix_keypad_resume); #endif static int __devinit init_matrix_gpio(struct platform_device *pdev, @@ -432,11 +434,12 @@ static int __devexit matrix_keypad_remove(struct platform_device *pdev) static struct platform_driver matrix_keypad_driver = { .probe = matrix_keypad_probe, .remove = __devexit_p(matrix_keypad_remove), - .suspend = matrix_keypad_suspend, - .resume = matrix_keypad_resume, .driver = { .name = "matrix-keypad", .owner = THIS_MODULE, +#ifdef CONFIG_PM + .pm = &matrix_keypad_pm_ops, +#endif }, };