From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [PATCH] spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functions Date: Thu, 16 Aug 2012 20:28:19 -0700 Message-ID: <20120817032819.GA6656@roeck-us.net> References: <1345173265-1721-1-git-send-email-linux@roeck-us.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Kukjin Kim , Thomas Abraham , Ben Dooks , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: Content-Disposition: inline In-Reply-To: <1345173265-1721-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org 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 > --- > 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/