aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-pci.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index fb7e436b40c7..69d4ec467dca 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -134,6 +134,7 @@ static void iwl_pci_apm_config(struct iwl_bus *bus)
134static void iwl_pci_set_drv_data(struct iwl_bus *bus, void *drv_data) 134static void iwl_pci_set_drv_data(struct iwl_bus *bus, void *drv_data)
135{ 135{
136 bus->drv_data = drv_data; 136 bus->drv_data = drv_data;
137 pci_set_drvdata(IWL_BUS_GET_PCI_DEV(bus), drv_data);
137} 138}
138 139
139static void iwl_pci_get_hw_id(struct iwl_bus *bus, char buf[], 140static void iwl_pci_get_hw_id(struct iwl_bus *bus, char buf[],
@@ -454,8 +455,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
454 pci_write_config_word(pdev, PCI_COMMAND, pci_cmd); 455 pci_write_config_word(pdev, PCI_COMMAND, pci_cmd);
455 } 456 }
456 457
457 pci_set_drvdata(pdev, bus);
458
459 bus->dev = &pdev->dev; 458 bus->dev = &pdev->dev;
460 bus->irq = pdev->irq; 459 bus->irq = pdev->irq;
461 bus->ops = &pci_ops; 460 bus->ops = &pci_ops;
@@ -494,11 +493,12 @@ static void iwl_pci_down(struct iwl_bus *bus)
494 493
495static void __devexit iwl_pci_remove(struct pci_dev *pdev) 494static void __devexit iwl_pci_remove(struct pci_dev *pdev)
496{ 495{
497 struct iwl_bus *bus = pci_get_drvdata(pdev); 496 struct iwl_priv *priv = pci_get_drvdata(pdev);
497 void *bus_specific = priv->bus->bus_specific;
498 498
499 iwl_remove(bus->drv_data); 499 iwl_remove(priv);
500 500
501 iwl_pci_down(bus); 501 iwl_pci_down(bus_specific);
502} 502}
503 503
504#ifdef CONFIG_PM 504#ifdef CONFIG_PM
@@ -506,20 +506,20 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
506static int iwl_pci_suspend(struct device *device) 506static int iwl_pci_suspend(struct device *device)
507{ 507{
508 struct pci_dev *pdev = to_pci_dev(device); 508 struct pci_dev *pdev = to_pci_dev(device);
509 struct iwl_bus *bus = pci_get_drvdata(pdev); 509 struct iwl_priv *priv = pci_get_drvdata(pdev);
510 510
511 /* Before you put code here, think about WoWLAN. You cannot check here 511 /* Before you put code here, think about WoWLAN. You cannot check here
512 * whether WoWLAN is enabled or not, and your code will run even if 512 * whether WoWLAN is enabled or not, and your code will run even if
513 * WoWLAN is enabled - don't kill the NIC, someone may need it in Sx. 513 * WoWLAN is enabled - don't kill the NIC, someone may need it in Sx.
514 */ 514 */
515 515
516 return iwl_suspend(bus->drv_data); 516 return iwl_suspend(priv);
517} 517}
518 518
519static int iwl_pci_resume(struct device *device) 519static int iwl_pci_resume(struct device *device)
520{ 520{
521 struct pci_dev *pdev = to_pci_dev(device); 521 struct pci_dev *pdev = to_pci_dev(device);
522 struct iwl_bus *bus = pci_get_drvdata(pdev); 522 struct iwl_priv *priv = pci_get_drvdata(pdev);
523 523
524 /* Before you put code here, think about WoWLAN. You cannot check here 524 /* Before you put code here, think about WoWLAN. You cannot check here
525 * whether WoWLAN is enabled or not, and your code will run even if 525 * whether WoWLAN is enabled or not, and your code will run even if
@@ -532,7 +532,7 @@ static int iwl_pci_resume(struct device *device)
532 */ 532 */
533 pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00); 533 pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00);
534 534
535 return iwl_resume(bus->drv_data); 535 return iwl_resume(priv);
536} 536}
537 537
538static SIMPLE_DEV_PM_OPS(iwl_dev_pm_ops, iwl_pci_suspend, iwl_pci_resume); 538static SIMPLE_DEV_PM_OPS(iwl_dev_pm_ops, iwl_pci_suspend, iwl_pci_resume);