Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266278
b: refs/heads/master
c: 18d0077
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Sep 19, 2011
1 parent 3b90ff0 commit d680ddf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca934b6715c134573da5acea01e9258eb0bf7c27
refs/heads/master: 18d0077f0c4a3b88a04bf164db39671edafc30b8
4 changes: 1 addition & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3186,9 +3186,9 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
priv = hw->priv;
priv->bus = bus;
priv->shrd = &priv->_shrd;
bus->shrd = priv->shrd;
priv->shrd->bus = bus;
priv->shrd->priv = priv;
bus_set_drv_data(priv->bus, priv->shrd);

priv->shrd->trans = trans_ops->alloc(priv->shrd);
if (priv->shrd->trans == NULL) {
Expand Down Expand Up @@ -3387,8 +3387,6 @@ void __devexit iwl_remove(struct iwl_priv * priv)

iwl_trans_free(trans(priv));

bus_set_drv_data(priv->bus, NULL);

iwl_uninit_drv(priv);

dev_kfree_skb(priv->beacon_skb);
Expand Down
10 changes: 2 additions & 8 deletions trunk/drivers/net/wireless/iwlwifi/iwl-bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ struct iwl_bus;
* struct iwl_bus_ops - bus specific operations
* @get_pm_support: must returns true if the bus can go to sleep
* @apm_config: will be called during the config of the APM
* @set_drv_data: set the shared data pointer to the bus layer
* @get_hw_id: prints the hw_id in the provided buffer
* @write8: write a byte to register at offset ofs
* @write32: write a dword to register at offset ofs
Expand All @@ -131,7 +130,6 @@ struct iwl_bus;
struct iwl_bus_ops {
bool (*get_pm_support)(struct iwl_bus *bus);
void (*apm_config)(struct iwl_bus *bus);
void (*set_drv_data)(struct iwl_bus *bus, struct iwl_shared *shrd);
void (*get_hw_id)(struct iwl_bus *bus, char buf[], int buf_len);
void (*write8)(struct iwl_bus *bus, u32 ofs, u8 val);
void (*write32)(struct iwl_bus *bus, u32 ofs, u32 val);
Expand All @@ -146,6 +144,8 @@ struct iwl_bus_ops {
* @dev - pointer to struct device * that represents the device
* @ops - pointer to iwl_bus_ops
* @shrd - pointer to iwl_shared which holds shared data from the upper layer
* NB: for the time being this needs to be set by the upper layer since
* it allocates the shared data
* @irq - the irq number for the device
* @reg_lock - protect hw register access
*/
Expand All @@ -172,12 +172,6 @@ static inline void bus_apm_config(struct iwl_bus *bus)
bus->ops->apm_config(bus);
}

static inline void bus_set_drv_data(struct iwl_bus *bus,
struct iwl_shared *shrd)
{
bus->ops->set_drv_data(bus, shrd);
}

static inline void bus_get_hw_id(struct iwl_bus *bus, char buf[], int buf_len)
{
bus->ops->get_hw_id(bus, buf, buf_len);
Expand Down
19 changes: 8 additions & 11 deletions trunk/drivers/net/wireless/iwlwifi/iwl-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ static void iwl_pci_apm_config(struct iwl_bus *bus)
}
}

static void iwl_pci_set_drv_data(struct iwl_bus *bus, struct iwl_shared *shrd)
{
bus->shrd = shrd;
pci_set_drvdata(IWL_BUS_GET_PCI_DEV(bus), shrd);
}

static void iwl_pci_get_hw_id(struct iwl_bus *bus, char buf[],
int buf_len)
{
Expand Down Expand Up @@ -168,7 +162,6 @@ static u32 iwl_pci_read32(struct iwl_bus *bus, u32 ofs)
static const struct iwl_bus_ops bus_ops_pci = {
.get_pm_support = iwl_pci_is_pm_supported,
.apm_config = iwl_pci_apm_config,
.set_drv_data = iwl_pci_set_drv_data,
.get_hw_id = iwl_pci_get_hw_id,
.write8 = iwl_pci_write8,
.write32 = iwl_pci_write32,
Expand Down Expand Up @@ -393,6 +386,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_bus = IWL_BUS_GET_PCI_BUS(bus);
pci_bus->pci_dev = pdev;

pci_set_drvdata(pdev, bus);

/* W/A - seems to solve weird behavior. We need to remove this if we
* don't want to stay in L1 all the time. This wastes a lot of power */
pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
Expand Down Expand Up @@ -486,9 +481,9 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

static void __devexit iwl_pci_remove(struct pci_dev *pdev)
{
struct iwl_shared *shrd = pci_get_drvdata(pdev);
struct iwl_bus *bus = shrd->bus;
struct iwl_bus *bus = pci_get_drvdata(pdev);
struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus);
struct iwl_shared *shrd = bus->shrd;

iwl_remove(shrd->priv);

Expand All @@ -506,7 +501,8 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
static int iwl_pci_suspend(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
struct iwl_shared *shrd = pci_get_drvdata(pdev);
struct iwl_bus *bus = pci_get_drvdata(pdev);
struct iwl_shared *shrd = bus->shrd;

/* Before you put code here, think about WoWLAN. You cannot check here
* whether WoWLAN is enabled or not, and your code will run even if
Expand All @@ -519,7 +515,8 @@ static int iwl_pci_suspend(struct device *device)
static int iwl_pci_resume(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
struct iwl_shared *shrd = pci_get_drvdata(pdev);
struct iwl_bus *bus = pci_get_drvdata(pdev);
struct iwl_shared *shrd = bus->shrd;

/* Before you put code here, think about WoWLAN. You cannot check here
* whether WoWLAN is enabled or not, and your code will run even if
Expand Down

0 comments on commit d680ddf

Please sign in to comment.