linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi/pl022: remove function cannot exit
@ 2011-08-02  9:29 Linus Walleij
  2011-08-02 13:54 ` Grant Likely
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2011-08-02  9:29 UTC (permalink / raw)
  To: Grant Likely, spi-devel-general
  Cc: Linus Walleij, Lee Jones, linux-arm-kernel

From: Linus Walleij <linus.walleij@linaro.org>

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 <linux@arm.linux.org.uk>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 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;
 }
 
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi/pl022: remove function cannot exit
  2011-08-02  9:29 [PATCH] spi/pl022: remove function cannot exit Linus Walleij
@ 2011-08-02 13:54 ` Grant Likely
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2011-08-02 13:54 UTC (permalink / raw)
  To: Linus Walleij
  Cc: spi-devel-general, Linus Walleij, Lee Jones, linux-arm-kernel

On Tue, Aug 02, 2011 at 11:29:24AM +0200, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
> 
> 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 <linux@arm.linux.org.uk>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Applied, thanks.

g.

> ---
>  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;
>  }
>  
> -- 
> 1.7.6
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-02 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-02  9:29 [PATCH] spi/pl022: remove function cannot exit Linus Walleij
2011-08-02 13:54 ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).