From patchwork Wed May 29 12:17:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 2629551 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E4FC040077 for ; Wed, 29 May 2013 12:17:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965487Ab3E2MRz (ORCPT ); Wed, 29 May 2013 08:17:55 -0400 Received: from smtp-out-220.synserver.de ([212.40.185.220]:1090 "EHLO smtp-out-220.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965495Ab3E2MRy (ORCPT ); Wed, 29 May 2013 08:17:54 -0400 Received: (qmail 20142 invoked by uid 0); 29 May 2013 12:17:50 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 20078 Received: from eisbaer.ursus-maritimus.org (HELO lars-adi-laptop.analog.com) [78.47.220.141] by 217.119.54.96 with SMTP; 29 May 2013 12:17:48 -0000 From: Lars-Peter Clausen To: Jean-Christophe Plagniol-Villard , Tomi Valkeinen Cc: Michael Hennerich , linux-fbdev@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH] fbdev: bfin-lq035q1-fb: Use dev_pm_ops Date: Wed, 29 May 2013 14:17:39 +0200 Message-Id: <1369829859-13405-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Use dev_pm_ops instead of the legacy suspend/resume callbacks. Signed-off-by: Lars-Peter Clausen Acked-by: Michael Hennerich --- drivers/video/bfin-lq035q1-fb.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c index 29d8c04..6084c17 100644 --- a/drivers/video/bfin-lq035q1-fb.c +++ b/drivers/video/bfin-lq035q1-fb.c @@ -170,16 +170,19 @@ static int lq035q1_spidev_remove(struct spi_device *spi) return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); } -#ifdef CONFIG_PM -static int lq035q1_spidev_suspend(struct spi_device *spi, pm_message_t state) +#ifdef CONFIG_PM_SLEEP +static int lq035q1_spidev_suspend(struct device *dev) { + struct spi_device *spi = to_spi_device(dev); + return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_SHUT); } -static int lq035q1_spidev_resume(struct spi_device *spi) +static int lq035q1_spidev_resume(struct device *dev) { - int ret; + struct spi_device *spi = to_spi_device(dev); struct spi_control *ctl = spi_get_drvdata(spi); + int ret; ret = lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode); if (ret) @@ -187,9 +190,13 @@ static int lq035q1_spidev_resume(struct spi_device *spi) return lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON); } + +static SIMPLE_DEV_PM_OPS(lq035q1_spidev_pm_ops, lq035q1_spidev_suspend, + lq035q1_spidev_resume); +#define LQ035Q1_SPIDEV_PM_OPS (&lq035q1_spidev_pm_ops) + #else -# define lq035q1_spidev_suspend NULL -# define lq035q1_spidev_resume NULL +#define LQ035Q1_SPIDEV_PM_OPS NULL #endif /* Power down all displays on reboot, poweroff or halt */ @@ -708,8 +715,7 @@ static int bfin_lq035q1_probe(struct platform_device *pdev) info->spidrv.probe = lq035q1_spidev_probe; info->spidrv.remove = lq035q1_spidev_remove; info->spidrv.shutdown = lq035q1_spidev_shutdown; - info->spidrv.suspend = lq035q1_spidev_suspend; - info->spidrv.resume = lq035q1_spidev_resume; + info->spidrv.driver.pm = LQ035Q1_SPIDEV_PM_OPS; ret = spi_register_driver(&info->spidrv); if (ret < 0) {