linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functions
@ 2012-08-17  3:14 Guenter Roeck
       [not found] ` <1345173265-1721-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
  2012-08-27 17:19 ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Guenter Roeck @ 2012-08-17  3:14 UTC (permalink / raw)
  To: spi-devel-general
  Cc: Ben Dooks, Kukjin Kim, Grant Likely, Thomas Abraham,
	linux-arm-kernel, linux-samsung-soc, Guenter Roeck

Suspend and resume functions call spi_master_get() without matching
spi_master_put(). The extra references are unnecessary and cause subsequent
module unload attempts to fail. Drop the calls.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/spi/spi-s3c64xx.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 646a765..d7a87df 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1409,7 +1409,7 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM
 static int s3c64xx_spi_suspend(struct device *dev)
 {
-	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
+	struct spi_master *master = dev_get_drvdata(dev);
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 
 	spi_master_suspend(master);
@@ -1428,7 +1428,7 @@ static int s3c64xx_spi_suspend(struct device *dev)
 
 static int s3c64xx_spi_resume(struct device *dev)
 {
-	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
+	struct spi_master *master = dev_get_drvdata(dev);
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 	struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
 
@@ -1452,7 +1452,7 @@ static int s3c64xx_spi_resume(struct device *dev)
 #ifdef CONFIG_PM_RUNTIME
 static int s3c64xx_spi_runtime_suspend(struct device *dev)
 {
-	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
+	struct spi_master *master = dev_get_drvdata(dev);
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 
 	clk_disable(sdd->clk);
@@ -1463,7 +1463,7 @@ static int s3c64xx_spi_runtime_suspend(struct device *dev)
 
 static int s3c64xx_spi_runtime_resume(struct device *dev)
 {
-	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
+	struct spi_master *master = dev_get_drvdata(dev);
 	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 
 	clk_enable(sdd->src_clk);
-- 
1.7.9.7

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

* Re: [PATCH] spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functions
       [not found] ` <1345173265-1721-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2012-08-17  3:28   ` Guenter Roeck
  2012-08-23  5:40   ` Kukjin Kim
  1 sibling, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2012-08-17  3:28 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Kukjin Kim,
	Thomas Abraham, Ben Dooks,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Sigh.

s/remove/resume/ in headline.

Guenter

On Thu, Aug 16, 2012 at 08:14:25PM -0700, Guenter Roeck wrote:
> Suspend and resume functions call spi_master_get() without matching
> spi_master_put(). The extra references are unnecessary and cause subsequent
> module unload attempts to fail. Drop the calls.
> 
> Signed-off-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
> ---
>  drivers/spi/spi-s3c64xx.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index 646a765..d7a87df 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -1409,7 +1409,7 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
>  #ifdef CONFIG_PM
>  static int s3c64xx_spi_suspend(struct device *dev)
>  {
> -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> +	struct spi_master *master = dev_get_drvdata(dev);
>  	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
>  
>  	spi_master_suspend(master);
> @@ -1428,7 +1428,7 @@ static int s3c64xx_spi_suspend(struct device *dev)
>  
>  static int s3c64xx_spi_resume(struct device *dev)
>  {
> -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> +	struct spi_master *master = dev_get_drvdata(dev);
>  	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
>  	struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
>  
> @@ -1452,7 +1452,7 @@ static int s3c64xx_spi_resume(struct device *dev)
>  #ifdef CONFIG_PM_RUNTIME
>  static int s3c64xx_spi_runtime_suspend(struct device *dev)
>  {
> -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> +	struct spi_master *master = dev_get_drvdata(dev);
>  	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
>  
>  	clk_disable(sdd->clk);
> @@ -1463,7 +1463,7 @@ static int s3c64xx_spi_runtime_suspend(struct device *dev)
>  
>  static int s3c64xx_spi_runtime_resume(struct device *dev)
>  {
> -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> +	struct spi_master *master = dev_get_drvdata(dev);
>  	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
>  
>  	clk_enable(sdd->src_clk);
> -- 
> 1.7.9.7
> 
> 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

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

* RE: [PATCH] spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functions
       [not found] ` <1345173265-1721-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
  2012-08-17  3:28   ` Guenter Roeck
@ 2012-08-23  5:40   ` Kukjin Kim
  2012-08-23 13:39     ` Guenter Roeck
  1 sibling, 1 reply; 5+ messages in thread
From: Kukjin Kim @ 2012-08-23  5:40 UTC (permalink / raw)
  To: 'Guenter Roeck',
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, 'Mark Brown',
	'Thomas Abraham', 'Ben Dooks',
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Guenter Roeck wrote:
> 
> Suspend and resume functions call spi_master_get() without matching
> spi_master_put(). The extra references are unnecessary and cause
> subsequent
> module unload attempts to fail. Drop the calls.
> 
> Signed-off-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

Acked-by: Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

(Cc'ed Mark Brown who is handling spi now)

Guenter, maybe you need to re-send this patch to Mark so that he can apply
;-)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

> ---
>  drivers/spi/spi-s3c64xx.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index 646a765..d7a87df 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -1409,7 +1409,7 @@ static int s3c64xx_spi_remove(struct platform_device
> *pdev)
>  #ifdef CONFIG_PM
>  static int s3c64xx_spi_suspend(struct device *dev)
>  {
> -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> +	struct spi_master *master = dev_get_drvdata(dev);
>  	struct s3c64xx_spi_driver_data *sdd =
> spi_master_get_devdata(master);
> 
>  	spi_master_suspend(master);
> @@ -1428,7 +1428,7 @@ static int s3c64xx_spi_suspend(struct device *dev)
> 
>  static int s3c64xx_spi_resume(struct device *dev)
>  {
> -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> +	struct spi_master *master = dev_get_drvdata(dev);
>  	struct s3c64xx_spi_driver_data *sdd =
> spi_master_get_devdata(master);
>  	struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
> 
> @@ -1452,7 +1452,7 @@ static int s3c64xx_spi_resume(struct device *dev)
>  #ifdef CONFIG_PM_RUNTIME
>  static int s3c64xx_spi_runtime_suspend(struct device *dev)
>  {
> -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> +	struct spi_master *master = dev_get_drvdata(dev);
>  	struct s3c64xx_spi_driver_data *sdd =
> spi_master_get_devdata(master);
> 
>  	clk_disable(sdd->clk);
> @@ -1463,7 +1463,7 @@ static int s3c64xx_spi_runtime_suspend(struct device
> *dev)
> 
>  static int s3c64xx_spi_runtime_resume(struct device *dev)
>  {
> -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> +	struct spi_master *master = dev_get_drvdata(dev);
>  	struct s3c64xx_spi_driver_data *sdd =
> spi_master_get_devdata(master);
> 
>  	clk_enable(sdd->src_clk);
> --
> 1.7.9.7


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

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

* Re: [PATCH] spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functions
  2012-08-23  5:40   ` Kukjin Kim
@ 2012-08-23 13:39     ` Guenter Roeck
  0 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2012-08-23 13:39 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: spi-devel-general, 'Ben Dooks', 'Grant Likely',
	'Thomas Abraham',
	linux-arm-kernel, linux-samsung-soc, 'Mark Brown'

On Thu, Aug 23, 2012 at 02:40:45PM +0900, Kukjin Kim wrote:
> Guenter Roeck wrote:
> > 
> > Suspend and resume functions call spi_master_get() without matching
> > spi_master_put(). The extra references are unnecessary and cause
> > subsequent
> > module unload attempts to fail. Drop the calls.
> > 
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> 
> Acked-by: Kukjin Kim <kgene.kim@samsung.com>
> 
> (Cc'ed Mark Brown who is handling spi now)
> 
> Guenter, maybe you need to re-send this patch to Mark so that he can apply
> ;-)
> 
Guess you are right - and I did copy Mark on my later patches. Mark, I just
bounced the patch to you, so you should have it now.

Thanks,
Guenter

> Thanks.
> 
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
> 
> > ---
> >  drivers/spi/spi-s3c64xx.c |    8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> > index 646a765..d7a87df 100644
> > --- a/drivers/spi/spi-s3c64xx.c
> > +++ b/drivers/spi/spi-s3c64xx.c
> > @@ -1409,7 +1409,7 @@ static int s3c64xx_spi_remove(struct platform_device
> > *pdev)
> >  #ifdef CONFIG_PM
> >  static int s3c64xx_spi_suspend(struct device *dev)
> >  {
> > -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> > +	struct spi_master *master = dev_get_drvdata(dev);
> >  	struct s3c64xx_spi_driver_data *sdd =
> > spi_master_get_devdata(master);
> > 
> >  	spi_master_suspend(master);
> > @@ -1428,7 +1428,7 @@ static int s3c64xx_spi_suspend(struct device *dev)
> > 
> >  static int s3c64xx_spi_resume(struct device *dev)
> >  {
> > -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> > +	struct spi_master *master = dev_get_drvdata(dev);
> >  	struct s3c64xx_spi_driver_data *sdd =
> > spi_master_get_devdata(master);
> >  	struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
> > 
> > @@ -1452,7 +1452,7 @@ static int s3c64xx_spi_resume(struct device *dev)
> >  #ifdef CONFIG_PM_RUNTIME
> >  static int s3c64xx_spi_runtime_suspend(struct device *dev)
> >  {
> > -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> > +	struct spi_master *master = dev_get_drvdata(dev);
> >  	struct s3c64xx_spi_driver_data *sdd =
> > spi_master_get_devdata(master);
> > 
> >  	clk_disable(sdd->clk);
> > @@ -1463,7 +1463,7 @@ static int s3c64xx_spi_runtime_suspend(struct device
> > *dev)
> > 
> >  static int s3c64xx_spi_runtime_resume(struct device *dev)
> >  {
> > -	struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
> > +	struct spi_master *master = dev_get_drvdata(dev);
> >  	struct s3c64xx_spi_driver_data *sdd =
> > spi_master_get_devdata(master);
> > 
> >  	clk_enable(sdd->src_clk);
> > --
> > 1.7.9.7
> 
> 

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

* Re: [PATCH] spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functions
  2012-08-17  3:14 [PATCH] spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functions Guenter Roeck
       [not found] ` <1345173265-1721-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
@ 2012-08-27 17:19 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2012-08-27 17:19 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: spi-devel-general, Ben Dooks, Kukjin Kim, Grant Likely,
	Thomas Abraham, linux-arm-kernel, linux-samsung-soc

On Thu, Aug 16, 2012 at 08:14:25PM -0700, Guenter Roeck wrote:
> Suspend and resume functions call spi_master_get() without matching
> spi_master_put(). The extra references are unnecessary and cause subsequent
> module unload attempts to fail. Drop the calls.

Applied, thanks.

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

end of thread, other threads:[~2012-08-27 17:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-17  3:14 [PATCH] spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functions Guenter Roeck
     [not found] ` <1345173265-1721-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2012-08-17  3:28   ` Guenter Roeck
2012-08-23  5:40   ` Kukjin Kim
2012-08-23 13:39     ` Guenter Roeck
2012-08-27 17:19 ` Mark Brown

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