From patchwork Sat Jan 18 23:48:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 312343 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 798E12C00A3 for ; Sun, 19 Jan 2014 10:49:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbaARXti (ORCPT ); Sat, 18 Jan 2014 18:49:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4573 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880AbaARXtg (ORCPT ); Sat, 18 Jan 2014 18:49:36 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0INn9vk015882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 18 Jan 2014 18:49:09 -0500 Received: from shalem.localdomain.com (vpn1-4-230.ams2.redhat.com [10.36.4.230]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s0INmukf020501; Sat, 18 Jan 2014 18:49:07 -0500 From: Hans de Goede To: Tejun Heo Cc: Oliver Schinagl , Maxime Ripard , Richard Zhu , linux-ide@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree , linux-sunxi@googlegroups.com, Hans de Goede Subject: [RFC v3 04/13] ahci-platform: Undo pdata->resume on resume failure Date: Sun, 19 Jan 2014 00:48:46 +0100 Message-Id: <1390088935-7193-5-git-send-email-hdegoede@redhat.com> In-Reply-To: <1390088935-7193-1-git-send-email-hdegoede@redhat.com> References: <1390088935-7193-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org When the ahci_resume fails the error handling code tries to undo all changes made, but it was not undoing the results of pdata->resume. Signed-off-by: Hans de Goede --- drivers/ata/ahci_platform.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index dc1ef73..41720cb 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -307,7 +307,7 @@ static int ahci_resume(struct device *dev) if (dev->power.power_state.event == PM_EVENT_SUSPEND) { rc = ahci_reset_controller(host); if (rc) - goto disable_unprepare_clk; + goto pdata_suspend; ahci_init_controller(host); } @@ -316,6 +316,9 @@ static int ahci_resume(struct device *dev) return 0; +pdata_suspend: + if (pdata && pdata->suspend) + pdata->suspend(dev); disable_unprepare_clk: if (!IS_ERR(hpriv->clk)) clk_disable_unprepare(hpriv->clk);