From patchwork Fri Aug 17 03:26:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 1336571 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork2.kernel.org (Postfix) with ESMTP id 64119DF266 for ; Fri, 17 Aug 2012 03:26:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1T2DCP-0000tL-LH; Fri, 17 Aug 2012 03:26:13 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1T2DCP-0000tE-1K for spi-devel-general@lists.sourceforge.net; Fri, 17 Aug 2012 03:26:13 +0000 X-ACL-Warn: Received: from mail.active-venture.com ([67.228.131.205]) by sog-mx-3.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1T2DCO-0007l9-CO for spi-devel-general@lists.sourceforge.net; Fri, 17 Aug 2012 03:26:13 +0000 Received: (qmail 91950 invoked by uid 399); 17 Aug 2012 03:26:03 -0000 X-Virus-Scan: Scanned by ClamAV 0.97.2 (no viruses); Thu, 16 Aug 2012 22:26:03 -0500 Received: from unknown (HELO localhost) (guenter@roeck-us.net@108.223.40.66) by mail.active-venture.com with ESMTPAM; 17 Aug 2012 03:26:02 -0000 X-Originating-IP: 108.223.40.66 X-Sender: guenter@roeck-us.net From: Guenter Roeck To: spi-devel-general@lists.sourceforge.net Subject: [PATCH 2/2] spi/coldfire-qspi: Drop extra calls to spi_master_get in suspend/resume functions Date: Thu, 16 Aug 2012 20:26:00 -0700 Message-Id: <1345173960-6138-2-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.7.9.7 In-Reply-To: <1345173960-6138-1-git-send-email-linux@roeck-us.net> References: <1345173960-6138-1-git-send-email-linux@roeck-us.net> X-Spam-Score: 0.9 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 1.6 RCVD_IN_BRBL_LASTEXT RBL: RCVD_IN_BRBL_LASTEXT [67.228.131.205 listed in bb.barracudacentral.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.8 AWL AWL: From: address is in the auto white-list X-Headers-End: 1T2DCO-0007l9-CO Cc: Mark Brown , Guenter Roeck X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net 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, so drop the calls. Signed-off-by: Guenter Roeck --- drivers/spi/spi-coldfire-qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index 1a30b47..764bfee 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c @@ -540,7 +540,7 @@ static int __devexit mcfqspi_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int mcfqspi_suspend(struct device *dev) { - struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); + struct spi_master *master = dev_get_drvdata(dev); struct mcfqspi *mcfqspi = spi_master_get_devdata(master); spi_master_suspend(master); @@ -552,7 +552,7 @@ static int mcfqspi_suspend(struct device *dev) static int mcfqspi_resume(struct device *dev) { - struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); + struct spi_master *master = dev_get_drvdata(dev); struct mcfqspi *mcfqspi = spi_master_get_devdata(master); spi_master_resume(master);