iwlwifi: use bus_get_hw_id for IWL_TM_CMD_APP2DEV_GET_DEVICE_ID
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / iwlwifi / iwl-testmode.c
index 05d301687daebd91346f416df97f412b6adcfec5..4a5cddd2d56bfb867a21c6d00f49cd219743ce2a 100644 (file)
@@ -422,8 +422,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
        struct sk_buff *skb;
        unsigned char *rsp_data_ptr = NULL;
        int status = 0, rsp_data_len = 0;
-       char buf[32], *ptr = NULL;
-       unsigned int num, devid;
+       u32 devid;
 
        switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) {
        case IWL_TM_CMD_APP2DEV_GET_DEVICENAME:
@@ -534,14 +533,8 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
                break;
 
        case IWL_TM_CMD_APP2DEV_GET_DEVICE_ID:
-               bus_get_hw_id_string(bus(priv), buf, sizeof(buf));
-               ptr = buf;
-               strsep(&ptr, ":");
-               sscanf(strsep(&ptr, ":"), "%x", &num);
-               sscanf(strsep(&ptr, ":"), "%x", &devid);
-               IWL_INFO(priv, "Device ID = 0x%04x, SubDevice ID= 0x%04x\n",
-                               num, devid);
-               devid |= (num << 16);
+               devid = bus_get_hw_id(bus(priv));
+               IWL_INFO(priv, "hw version: 0x%x\n", devid);
 
                skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20);
                if (!skb) {