]> Pileus Git - ~andy/linux/commitdiff
iwlwifi: kill bus_get_hw_id_string
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 8 Jan 2012 19:19:45 +0000 (21:19 +0200)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Thu, 2 Feb 2012 22:37:29 +0000 (14:37 -0800)
Get this information from the transport layer.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-bus.h
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-pci.c
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
drivers/net/wireless/iwlwifi/iwl-trans.h

index 2b0b48edf2837e8fec58e652b022448a69ed1b2d..61130895428ac31574b41ebbd601dca374f0b289 100644 (file)
@@ -120,11 +120,9 @@ struct iwl_bus;
 
 /**
  * struct iwl_bus_ops - bus specific operations
- * @get_hw_id_string: prints the hw_id in the provided buffer
  * @get_hw_id: get hw_id in u32
  */
 struct iwl_bus_ops {
-       void (*get_hw_id_string)(struct iwl_bus *bus, char buf[], int buf_len);
        u32 (*get_hw_id)(struct iwl_bus *bus);
 };
 
@@ -147,12 +145,6 @@ struct iwl_bus {
        char bus_specific[0] __attribute__((__aligned__(sizeof(void *))));
 };
 
-static inline void bus_get_hw_id_string(struct iwl_bus *bus, char buf[],
-               int buf_len)
-{
-       bus->ops->get_hw_id_string(bus, buf, buf_len);
-}
-
 static inline u32 bus_get_hw_id(struct iwl_bus *bus)
 {
        return bus->ops->get_hw_id(bus);
index 95f2c33695b7a711b210ab689c5d03b9fba928ea..0677b3dfbfb2de98b351db54666f37841d4daeb1 100644 (file)
@@ -203,10 +203,9 @@ int iwl_init_geos(struct iwl_priv *priv)
 
        if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
             cfg(priv)->sku & EEPROM_SKU_CAP_BAND_52GHZ) {
-               char buf[32];
-               bus_get_hw_id_string(bus(priv), buf, sizeof(buf));
                IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
-                       "Please send your %s to maintainer.\n", buf);
+                       "Please send your %s to maintainer.\n",
+                       trans(priv)->hw_id_str);
                cfg(priv)->sku &= ~EEPROM_SKU_CAP_BAND_52GHZ;
        }
 
index 0c16efebf93d0fd1ffaed8d75a6003829e5b2190..15864760733a9a0d4121c205038ca0ef113d6cc8 100644 (file)
@@ -87,15 +87,6 @@ struct iwl_pci_bus {
 #define IWL_BUS_GET_PCI_DEV(_iwl_bus) \
                        ((IWL_BUS_GET_PCI_BUS(_iwl_bus))->pci_dev)
 
-static void iwl_pci_get_hw_id_string(struct iwl_bus *bus, char buf[],
-                             int buf_len)
-{
-       struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
-
-       snprintf(buf, buf_len, "PCI ID: 0x%04X:0x%04X", pci_dev->device,
-                pci_dev->subsystem_device);
-}
-
 static u32 iwl_pci_get_hw_id(struct iwl_bus *bus)
 {
        struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
@@ -104,7 +95,6 @@ static u32 iwl_pci_get_hw_id(struct iwl_bus *bus)
 }
 
 static const struct iwl_bus_ops bus_ops_pci = {
-       .get_hw_id_string = iwl_pci_get_hw_id_string,
        .get_hw_id = iwl_pci_get_hw_id,
 };
 
index 8ebb5a54441c7f234e174423f176b5d8dd95eae4..73ff68ac7c452ddb0c86108cca6188ae03e43050 100644 (file)
@@ -2317,6 +2317,8 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd,
        trans->dev = &pdev->dev;
        trans->irq = pdev->irq;
        trans_pcie->pci_dev = pdev;
+       snprintf(trans->hw_id_str, sizeof(trans->hw_id_str),
+                "PCI ID: 0x%04X:0x%04X", pdev->device, pdev->subsystem_device);
 
        /* TODO: Move this away, not needed if not MSI */
        /* enable rfkill interrupt: hw bug w/a */
index 7f6963ffa7ca198a96ab1f93e196b5678c36ec83..593102d89c745e7f721b955e6bd93b442b221edd 100644 (file)
@@ -234,6 +234,7 @@ struct iwl_calib_result {
  * @reg_lock - protect hw register access
  * @dev - pointer to struct device * that represents the device
  * @irq - the irq number for the device
+ * @hw_id_str: a string with info about HW ID. Set during transport allocation.
  * @ucode_write_complete: indicates that the ucode has been copied.
  * @ucode_rt: run time ucode image
  * @ucode_init: init ucode image
@@ -250,6 +251,7 @@ struct iwl_trans {
 
        struct device *dev;
        unsigned int irq;
+       char hw_id_str[52];
 
        u8 ucode_write_complete;        /* the image write is complete */
        struct fw_img ucode_rt;