linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel@vger.kernel.org, Erik Gilling <konkers@android.com>,
	spi-devel-general@lists.sourceforge.net
Subject: Re: [PATCH 2/2] spi: spi_tegra: calling spi_unregister_master instead of spi_master_put in spi_tegra_remove
Date: Thu, 19 May 2011 13:02:23 -0600	[thread overview]
Message-ID: <20110519190223.GH5109@ponder.secretlab.ca> (raw)
In-Reply-To: <1305120496.6324.8.camel@phoenix>

On Wed, May 11, 2011 at 09:28:16PM +0800, Axel Lin wrote:
> spi_master_put() should only be used in error handling.
> Once spi_register_master() returns success, we should call
> spi_unregister_master() instead.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Applied, thanks.

g.

> ---
>  drivers/spi/spi_tegra.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/spi/spi_tegra.c b/drivers/spi/spi_tegra.c
> index 891e590..6c3aa6e 100644
> --- a/drivers/spi/spi_tegra.c
> +++ b/drivers/spi/spi_tegra.c
> @@ -578,6 +578,7 @@ static int __devexit spi_tegra_remove(struct platform_device *pdev)
>  	master = dev_get_drvdata(&pdev->dev);
>  	tspi = spi_master_get_devdata(master);
>  
> +	spi_unregister_master(master);
>  	tegra_dma_free_channel(tspi->rx_dma);
>  
>  	dma_free_coherent(&pdev->dev, sizeof(u32) * BB_LEN,
> @@ -586,7 +587,6 @@ static int __devexit spi_tegra_remove(struct platform_device *pdev)
>  	clk_put(tspi->clk);
>  	iounmap(tspi->base);
>  
> -	spi_master_put(master);
>  	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	release_mem_region(r->start, (r->end - r->start) + 1);
>  
> -- 
> 1.7.1
> 
> 
> 

  reply	other threads:[~2011-05-19 19:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11 13:27 [PATCH 1/2] spi: spi_sh: calling spi_unregister_master instead of spi_master_put in spi_sh_remove Axel Lin
2011-05-11 13:28 ` [PATCH 2/2] spi: spi_tegra: calling spi_unregister_master instead of spi_master_put in spi_tegra_remove Axel Lin
2011-05-19 19:02   ` Grant Likely [this message]
2011-05-19 19:01 ` [PATCH 1/2] spi: spi_sh: calling spi_unregister_master instead of spi_master_put in spi_sh_remove Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110519190223.GH5109@ponder.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=axel.lin@gmail.com \
    --cc=konkers@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).