diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-05-31 08:52:10 +0300 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-06-18 08:06:24 -0700 |
commit | 3599d39a8525b01540e2c7ec8c5d0df0dd11d6cf (patch) | |
tree | fb9c0b512ac042c1b483d6ff754cd1fd8af5e135 /drivers/net/wireless/iwlwifi/iwl-pci.c | |
parent | a48709c5d076aa3a3f9b6426f462abe6bf432b11 (diff) |
iwlagn: add get_dev to iwl_bus_ops
Bus specific layer must know how to return the struct device* of the device.
Implement that as a callback of iwl_bus_ops and use that callback instead of
using the priv->pdev pointer which is meant to disappear soon.
Since the struct device * is needed in hot path, iwl_bus holds a pointer to it
instead of calling get_dev all the time.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-pci.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-pci.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c index ef9cb0813c6..00458fc2c40 100644 --- a/drivers/net/wireless/iwlwifi/iwl-pci.c +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c @@ -86,8 +86,14 @@ static void iwl_pci_set_drv_data(struct iwl_bus *bus, void *drv_priv) pci_set_drvdata(IWL_BUS_GET_PCI_DEV(bus), drv_priv); } +static struct device *iwl_pci_get_dev(const struct iwl_bus *bus) +{ + return &(IWL_BUS_GET_PCI_DEV(bus)->dev); +} + static struct iwl_bus_ops pci_ops = { .set_drv_data = iwl_pci_set_drv_data, + .get_dev = iwl_pci_get_dev, }; #define IWL_PCI_DEVICE(dev, subdev, cfg) \ |