From patchwork Tue Aug 2 09:29:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 3215 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 406B22406C for ; Tue, 2 Aug 2011 09:29:32 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 09F93A18422 for ; Tue, 2 Aug 2011 09:29:31 +0000 (UTC) Received: by qwb8 with SMTP id 8so4706996qwb.11 for ; Tue, 02 Aug 2011 02:29:31 -0700 (PDT) Received: by 10.229.231.66 with SMTP id jp2mr423320qcb.83.1312277371403; Tue, 02 Aug 2011 02:29:31 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.6.73 with SMTP id 9cs118401qcy; Tue, 2 Aug 2011 02:29:30 -0700 (PDT) Received: by 10.204.139.199 with SMTP id f7mr1607818bku.335.1312277369825; Tue, 02 Aug 2011 02:29:29 -0700 (PDT) Received: from mail.df.lth.se (mail.df.lth.se [194.47.250.12]) by mx.google.com with ESMTPS id r16si386499bkd.133.2011.08.02.02.29.28 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 02 Aug 2011 02:29:28 -0700 (PDT) Received-SPF: neutral (google.com: 194.47.250.12 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=194.47.250.12; Authentication-Results: mx.google.com; spf=neutral (google.com: 194.47.250.12 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from localhost.localdomain (unknown [109.234.204.184]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPSA id 1D01165D61; Tue, 2 Aug 2011 11:29:26 +0200 (CEST) From: Linus Walleij To: Grant Likely , spi-devel-general@lists.sourceforge.net Cc: linux-arm-kernel@lists.infradead.org, Lee Jones , Linus Walleij Subject: [PATCH] spi/pl022: remove function cannot exit Date: Tue, 2 Aug 2011 11:29:24 +0200 Message-Id: <1312277364-12945-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.6 From: Linus Walleij The remove function in the PL022 driver cannot abort the remove function any way, so restructure the code so as not to make that assumption. Remove will now proceed no matter whether it can stop the transfer queue or not. Reported-by: Russell King Signed-off-by: Linus Walleij --- drivers/spi/spi-pl022.c | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index eba88c7..730b4a3 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2267,17 +2267,13 @@ static int __devexit pl022_remove(struct amba_device *adev) { struct pl022 *pl022 = amba_get_drvdata(adev); - int status = 0; + if (!pl022) return 0; /* Remove the queue */ - status = destroy_queue(pl022); - if (status != 0) { - dev_err(&adev->dev, - "queue remove failed (%d)\n", status); - return status; - } + if (destroy_queue(pl022) != 0) + dev_err(&adev->dev, "queue remove failed\n"); load_ssp_default_config(pl022); pl022_dma_remove(pl022); free_irq(adev->irq[0], pl022); @@ -2289,7 +2285,6 @@ pl022_remove(struct amba_device *adev) spi_unregister_master(pl022->master); spi_master_put(pl022->master); amba_set_drvdata(adev, NULL); - dev_dbg(&adev->dev, "remove succeeded\n"); return 0; }