From patchwork Thu Feb 23 09:33:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh KUMAR X-Patchwork-Id: 142584 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2FA76B6ED0 for ; Thu, 23 Feb 2012 20:45:18 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754463Ab2BWJpQ (ORCPT ); Thu, 23 Feb 2012 04:45:16 -0500 Received: from eu1sys200aog114.obsmtp.com ([207.126.144.137]:54285 "EHLO eu1sys200aog114.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754079Ab2BWJpP (ORCPT ); Thu, 23 Feb 2012 04:45:15 -0500 Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob114.postini.com ([207.126.147.11]) with SMTP ID DSNKT0YKo2lIc6mRJA0fJmjYTv7ZAIALUeDi@postini.com; Thu, 23 Feb 2012 09:45:14 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 5D0D5F1; Thu, 23 Feb 2012 09:36:38 +0000 (GMT) Received: from Webmail-ap.st.com (eapex1hubcas4.st.com [10.80.176.69]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id A397F349; Thu, 23 Feb 2012 09:45:04 +0000 (GMT) Received: from localhost (10.199.82.50) by Webmail-ap.st.com (10.80.176.7) with Microsoft SMTP Server (TLS) id 8.3.192.1; Thu, 23 Feb 2012 17:44:54 +0800 From: Viresh Kumar To: Cc: , , , , , , , , , , , , , , Subject: [PATCH] ata/pata_arasan_cf: Add Hibernation support Date: Thu, 23 Feb 2012 15:03:53 +0530 Message-ID: <788f006c530a7577380d75a60ba9ab23e8d975c9.1329989550.git.viresh.kumar@st.com> X-Mailer: git-send-email 1.7.8.110.g4cb5d MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This patch adds in Hibernation related callbacks. Also we don't really need to free DMA channel on suspend. Signed-off-by: Viresh Kumar --- drivers/ata/pata_arasan_cf.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c index 048589f..fc2db2a 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c @@ -925,11 +925,10 @@ static int arasan_cf_suspend(struct device *dev) struct ata_host *host = dev_get_drvdata(dev); struct arasan_cf_dev *acdev = host->ports[0]->private_data; - if (acdev->dma_chan) { + if (acdev->dma_chan) acdev->dma_chan->device->device_control(acdev->dma_chan, DMA_TERMINATE_ALL, 0); - dma_release_channel(acdev->dma_chan); - } + cf_exit(acdev); return ata_host_suspend(host, PMSG_SUSPEND); } @@ -945,10 +944,7 @@ static int arasan_cf_resume(struct device *dev) return 0; } -static const struct dev_pm_ops arasan_cf_pm_ops = { - .suspend = arasan_cf_suspend, - .resume = arasan_cf_resume, -}; +static SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasan_cf_resume); #endif static struct platform_driver arasan_cf_driver = { @@ -958,7 +954,7 @@ static struct platform_driver arasan_cf_driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, #ifdef CONFIG_PM - .pm = &arasan_cf_pm_ops, + .pm = &arasan_cf_pm_ops, #endif }, };