linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: spi_sh: calling spi_unregister_master instead of spi_master_put in spi_sh_remove
@ 2011-05-11 13:27 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:01 ` [PATCH 1/2] spi: spi_sh: calling spi_unregister_master instead of spi_master_put in spi_sh_remove Grant Likely
  0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2011-05-11 13:27 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Yoshihiro Shimoda

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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/spi/spi_sh.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spi_sh.c b/drivers/spi/spi_sh.c
index 869a07d..9eedd71 100644
--- a/drivers/spi/spi_sh.c
+++ b/drivers/spi/spi_sh.c
@@ -427,10 +427,10 @@ static int __devexit spi_sh_remove(struct platform_device *pdev)
 {
 	struct spi_sh_data *ss = dev_get_drvdata(&pdev->dev);
 
+	spi_unregister_master(ss->master);
 	destroy_workqueue(ss->workqueue);
 	free_irq(ss->irq, ss);
 	iounmap(ss->addr);
-	spi_master_put(ss->master);
 
 	return 0;
 }
-- 
1.7.1




------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay

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

* [PATCH 2/2] spi: spi_tegra: calling spi_unregister_master instead of spi_master_put in spi_tegra_remove
  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 ` Axel Lin
  2011-05-19 19:02   ` Grant Likely
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Axel Lin @ 2011-05-11 13:28 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Erik Gilling

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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 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




------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay

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

* Re: [PATCH 1/2] spi: spi_sh: calling spi_unregister_master instead of spi_master_put in spi_sh_remove
  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:01 ` Grant Likely
  1 sibling, 0 replies; 4+ messages in thread
From: Grant Likely @ 2011-05-19 19:01 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Yoshihiro Shimoda, spi-devel-general

On Wed, May 11, 2011 at 09:27:00PM +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_sh.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/spi/spi_sh.c b/drivers/spi/spi_sh.c
> index 869a07d..9eedd71 100644
> --- a/drivers/spi/spi_sh.c
> +++ b/drivers/spi/spi_sh.c
> @@ -427,10 +427,10 @@ static int __devexit spi_sh_remove(struct platform_device *pdev)
>  {
>  	struct spi_sh_data *ss = dev_get_drvdata(&pdev->dev);
>  
> +	spi_unregister_master(ss->master);
>  	destroy_workqueue(ss->workqueue);
>  	free_irq(ss->irq, ss);
>  	iounmap(ss->addr);
> -	spi_master_put(ss->master);
>  
>  	return 0;
>  }
> -- 
> 1.7.1
> 
> 
> 

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

* Re: [PATCH 2/2] spi: spi_tegra: calling spi_unregister_master instead of spi_master_put in spi_tegra_remove
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2011-05-19 19:02 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Erik Gilling, spi-devel-general

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
> 
> 
> 

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

end of thread, other threads:[~2011-05-19 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).