From patchwork Mon Dec 27 11:23:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomoya X-Patchwork-Id: 435301 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBRMl3MR019371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 27 Dec 2010 22:47:25 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PXBEa-0002Ok-Ek; Mon, 27 Dec 2010 11:27:24 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PXBEa-0002Oc-0g for spi-devel-general@lists.sourceforge.net; Mon, 27 Dec 2010 11:27:24 +0000 X-ACL-Warn: Received: from sm-d311v.smileserver.ne.jp ([203.211.202.206]) by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.72) id 1PXBEV-00039M-TT for spi-devel-general@lists.sourceforge.net; Mon, 27 Dec 2010 11:27:23 +0000 X-Virus-Status: clean(F-Secure/virusgw_smtp/403/viruscheck2-00.private.hosting-pf.net) Received: from localhost.localdomain (113x35x143x224.ap113.ftth.ucom.ne.jp [113.35.143.224]) by sm-d311v.smileserver.ne.jp (mail) with ESMTPSA id 3E32096D86; Mon, 27 Dec 2010 20:27:13 +0900 (JST) From: Tomoya MORINAGA To: David Brownell , Grant Likely , spi-devel-general@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] spi_topcliff_pch: change calling function order correctly in remove Date: Mon, 27 Dec 2010 20:23:46 +0900 Message-Id: <1293449027-3219-2-git-send-email-tomoya-linux@dsn.okisemi.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1293449027-3219-1-git-send-email-tomoya-linux@dsn.okisemi.com> References: <1293449027-3219-1-git-send-email-tomoya-linux@dsn.okisemi.com> X-Spam-Score: 0.2 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.2 AWL AWL: From: address is in the auto white-list X-Headers-End: 1PXBEV-00039M-TT Cc: Tomoya MORINAGA , kok.howg.ewe@intel.com, qi.wang@intel.com, joel.clark@intel.com, yong.y.wang@intel.com 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Dec 2010 22:47:28 +0000 (UTC) diff --git a/drivers/spi/spi_topcliff_pch.c b/drivers/spi/spi_topcliff_pch.c index 18e077b..a796eaf 100644 --- a/drivers/spi/spi_topcliff_pch.c +++ b/drivers/spi/spi_topcliff_pch.c @@ -1166,21 +1166,21 @@ static void pch_spi_remove(struct pci_dev *pdev) spin_unlock(&board_dat->data[i]->lock); } - /* Free resources allocated for PCH SPI */ - pch_spi_free_resources(board_dat); - /* Unregister SPI master */ for (i = 0; i < board_dat->num; i++) spi_unregister_master(board_dat->data[i]->master); - /* free memory for private data */ - kfree(board_dat); + /* Free resources allocated for PCH SPI */ + pch_spi_free_resources(board_dat); pci_set_drvdata(pdev, NULL); /* disable PCI device */ pci_disable_device(pdev); + /* free memory for private data */ + kfree(board_dat); + dev_dbg(&pdev->dev, "%s invoked pci_disable_device\n", __func__); }