From patchwork Mon Mar 17 18:31:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 3845891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B883A9F369 for ; Mon, 17 Mar 2014 18:34:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7E8A20218 for ; Mon, 17 Mar 2014 18:34:20 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03FDF20213 for ; Mon, 17 Mar 2014 18:34:20 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPcLd-0001H4-Gp; Mon, 17 Mar 2014 18:33:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPcLR-00033X-Iv; Mon, 17 Mar 2014 18:33:05 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPcL1-0002zi-Oa for linux-arm-kernel@lists.infradead.org; Mon, 17 Mar 2014 18:32:40 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2L00I4BFHS3E30@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 18 Mar 2014 03:32:16 +0900 (KST) X-AuditID: cbfee61b-b7f456d000006dfd-96-53273fb0b79a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 07.AF.28157.0BF37235; Tue, 18 Mar 2014 03:32:16 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2L00380FHDPR10@mmp2.samsung.com>; Tue, 18 Mar 2014 03:32:16 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Tejun Heo Subject: [PATCH 1/4] ata: ahci_platform: fix ahci_platform_data->suspend method handling Date: Mon, 17 Mar 2014 19:31:55 +0100 Message-id: <1395081118-15248-2-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1395081118-15248-1-git-send-email-b.zolnierkie@samsung.com> References: <1395081118-15248-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrALMWRmVeSWpSXmKPExsVy+t9jQd0N9urBBmePyFhsnLGe1eLcrQZW izsrmC02Pb7GanFsxyMmi8u75rBZ7O/dwGTR0N3DbjFnxmZWi1/LjzJarLz4l9mB2+P6q/9M Hjtn3WX32LSqk81jzrQmFo+TF06yeGxeUu/Rt2UVo8fTH3uZPY7f2M7k8XmTXABXFJdNSmpO Zllqkb5dAldGd88sxoLfHBV/Jk1haWDczN7FyMkhIWAiMeneLFYIW0ziwr31bF2MXBxCAtMZ Jc4/3sUO4XQxSTQ9WwLWwSZgJTGxfRUjiC0iICtxZdpDRpAiZoHHTBI7V04BKxIWiJK4sWAZ 2FgWAVWJe4f2gzXwCnhIfNy1hw1inaJE97MJYDangKfE6h/fmUFsIaCaph3PmCcw8i5gZFjF KJpakFxQnJSea6RXnJhbXJqXrpecn7uJERyuz6R3MK5qsDjEKMDBqMTD+4JNPViINbGsuDL3 EKMEB7OSCK+ECVCINyWxsiq1KD++qDQntfgQozQHi5I478FW60AhgfTEktTs1NSC1CKYLBMH p1QDI/8d6a1HVq9pPlMguISb93HOwQaJo0L/IubPn3FA4KjZL2drt/cpH+xer+ms6rGI9px/ fU7IsSfOTUsOJJ2880yKSUzcVmi3xemQSD3xNS2i/xiXm9Q3xwSrbrYXvbu648AjgUPPt2iH zlC4Xnp8v7nIF/kKsZiba5Zwnp345vDvCP4QsYa6h0osxRmJhlrMRcWJAMcBwh5TAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140317_143239_997224_82AAF80C X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) Cc: davinci-linux-open-source@linux.davincidsp.com, Shiraz Hashim , Kevin Hilman , spear-devel@list.st.com, Sekhar Nori , linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, b.zolnierkie@samsung.com, Viresh Kumar , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Looking at ST SPEAr1340 AHCI code (the only user of the deprecated pdata->suspend and pdata->resume) it is obvious the we should return after calling pdata->suspend() only if the function have returned non-zero return value. The code has been broken since commit 1e70c2 ("ata/ahci_platform: Add clock framework support"). Fix it. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ata/ahci_platform.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 70fbf66..7bd6adf 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -521,12 +521,19 @@ int ahci_platform_suspend(struct device *dev) if (rc) return rc; - if (pdata && pdata->suspend) - return pdata->suspend(dev); + if (pdata && pdata->suspend) { + rc = pdata->suspend(dev); + if (rc) + goto resume_host; + } ahci_platform_disable_resources(hpriv); return 0; + +resume_host: + ahci_platform_resume_host(dev); + return rc; } EXPORT_SYMBOL_GPL(ahci_platform_suspend);