Return-path: Received: from mail-gy0-f174.google.com ([209.85.160.174]:33486 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756633Ab1HFTnw (ORCPT ); Sat, 6 Aug 2011 15:43:52 -0400 Received: by gya6 with SMTP id 6so704240gya.19 for ; Sat, 06 Aug 2011 12:43:52 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1312228017-12061-1-git-send-email-wey-yi.w.guy@intel.com> <4825B8A2C4E264489E57869F0DCFB22344563F4ABE@hasmsx502.ger.corp.intel.com> <1312499702.15170.17.camel@wwguy-huron> <20110805225051.435fe1b0@mj> Date: Sat, 6 Aug 2011 22:43:51 +0300 Message-ID: (sfid-20110806_214356_878868_1450E87B) Subject: Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer From: Emmanuel Grumbach To: "Guy, Wey-Yi W" Cc: Pavel Roskin , "Grumbach, Emmanuel" , Daniel Halperin , "linville@tuxdriver.com" , "linux-wireless@vger.kernel.org" Content-Type: multipart/mixed; boundary=000e0cd30bb8f5d91204a9db6e5d Sender: linux-wireless-owner@vger.kernel.org List-ID: --000e0cd30bb8f5d91204a9db6e5d Content-Type: text/plain; charset=ISO-8859-1 Can you please try that one ? I don't have my machine near me, and don't want to crash it remotely, so I didn't test it. I will test in on Sunday. diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c index 69d4ec4..2fdbffa 100644 --- a/drivers/net/wireless/iwlwifi/iwl-pci.c +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c @@ -478,27 +478,22 @@ out_no_pci: return err; } -static void iwl_pci_down(struct iwl_bus *bus) -{ - struct iwl_pci_bus *pci_bus = (struct iwl_pci_bus *) bus->bus_specific; - - pci_disable_msi(pci_bus->pci_dev); - pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base); - pci_release_regions(pci_bus->pci_dev); - pci_disable_device(pci_bus->pci_dev); - pci_set_drvdata(pci_bus->pci_dev, NULL); - - kfree(bus); -} - static void __devexit iwl_pci_remove(struct pci_dev *pdev) { struct iwl_priv *priv = pci_get_drvdata(pdev); - void *bus_specific = priv->bus->bus_specific; + struct iwl_bus *bus = priv->bus; + struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus); + struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus); iwl_remove(priv); - iwl_pci_down(bus_specific); + pci_disable_msi(pci_dev); + pci_iounmap(pci_dev, pci_bus->hw_base); + pci_release_regions(pci_dev); + pci_disable_device(pci_dev); + pci_set_drvdata(pci_dev, NULL); + + kfree(bus); } #ifdef CONFIG_PM --000e0cd30bb8f5d91204a9db6e5d Content-Type: application/octet-stream; name="pci_remove_fix.patch" Content-Disposition: attachment; filename="pci_remove_fix.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gr0zrouo0 ZGlmZiAtLWdpdCBhL2RyaXZlcnMvbmV0L3dpcmVsZXNzL2l3bHdpZmkvaXdsLXBjaS5jIGIvZHJp dmVycy9uZXQvd2lyZWxlc3MvaXdsd2lmaS9pd2wtcGNpLmMKaW5kZXggNjlkNGVjNC4uMmZkYmZm YSAxMDA2NDQKLS0tIGEvZHJpdmVycy9uZXQvd2lyZWxlc3MvaXdsd2lmaS9pd2wtcGNpLmMKKysr IGIvZHJpdmVycy9uZXQvd2lyZWxlc3MvaXdsd2lmaS9pd2wtcGNpLmMKQEAgLTQ3OCwyNyArNDc4 LDIyIEBAIG91dF9ub19wY2k6CiAJcmV0dXJuIGVycjsKIH0KIAotc3RhdGljIHZvaWQgaXdsX3Bj aV9kb3duKHN0cnVjdCBpd2xfYnVzICpidXMpCi17Ci0Jc3RydWN0IGl3bF9wY2lfYnVzICpwY2lf YnVzID0gKHN0cnVjdCBpd2xfcGNpX2J1cyAqKSBidXMtPmJ1c19zcGVjaWZpYzsKLQotCXBjaV9k aXNhYmxlX21zaShwY2lfYnVzLT5wY2lfZGV2KTsKLQlwY2lfaW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