So these errors are always emitted at KERN_ERR level.
Remove ARRAY_SIZE casts, use printf type %zu
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
 
        pdata = (struct ath9k_platform_data *) pdev->dev.platform_data;
        if (off >= (ARRAY_SIZE(pdata->eeprom_data))) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "%s: flash read failed, offset %08x "
-                         "is out of range\n",
-                         __func__, off);
+               ath_err(common,
+                       "%s: flash read failed, offset %08x is out of range\n",
+                       __func__, off);
                return false;
        }
 
 
                        channelSel = ((freq - 704) * 2 - 3040) / 10;
                        bModeSynth = 1;
                } else {
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "Invalid channel %u MHz\n", freq);
+                       ath_err(common, "Invalid channel %u MHz\n", freq);
                        return -EINVAL;
                }
 
                channelSel = ath9k_hw_reverse_bits((freq - 4800) / 5, 8);
                aModeRefSel = ath9k_hw_reverse_bits(1, 2);
        } else {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Invalid channel %u MHz\n", freq);
+               ath_err(common, "Invalid channel %u MHz\n", freq);
                return -EINVAL;
        }
 
 #define ATH_ALLOC_BANK(bank, size) do { \
                bank = kzalloc((sizeof(u32) * size), GFP_KERNEL); \
                if (!bank) { \
-                       ath_print(common, ATH_DBG_FATAL, \
-                                 "Cannot allocate RF banks\n"); \
+                       ath_err(common, "Cannot allocate RF banks\n"); \
                        return -ENOMEM; \
                } \
        } while (0);
 
        /* Write analog registers */
        if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) {
-               ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
-                         "ar5416SetRfRegs failed\n");
+               ath_err(ath9k_hw_common(ah), "ar5416SetRfRegs failed\n");
                return -EIO;
        }
 
 
        case AR_RAD2122_SREV_MAJOR:
                break;
        default:
-               ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
-                         "Radio Chip Rev 0x%02X not supported\n",
-                         val & AR_RADIO_SREV_MAJOR);
+               ath_err(ath9k_hw_common(ah),
+                       "Radio Chip Rev 0x%02X not supported\n",
+                       val & AR_RADIO_SREV_MAJOR);
                return -EOPNOTSUPP;
        }
 
 
        }
 
        if (!ath9k_hw_set_txq_props(ah, sc->beacon.beaconq, &qi)) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to update h/w beacon queue parameters\n");
+               ath_err(common,
+                       "Unable to update h/w beacon queue parameters\n");
                return 0;
        } else {
                ath9k_hw_resettxqueue(ah, sc->beacon.beaconq);
                dev_kfree_skb_any(skb);
                bf->bf_mpdu = NULL;
                bf->bf_buf_addr = 0;
-               ath_print(common, ATH_DBG_FATAL,
-                         "dma_mapping_error on beaconing\n");
+               ath_err(common, "dma_mapping_error on beaconing\n");
                return NULL;
        }
 
                dev_kfree_skb_any(skb);
                bf->bf_mpdu = NULL;
                bf->bf_buf_addr = 0;
-               ath_print(common, ATH_DBG_FATAL,
-                         "dma_mapping_error on beacon alloc\n");
+               ath_err(common, "dma_mapping_error on beacon alloc\n");
                return -ENOMEM;
        }
 
                 * are still pending on the queue.
                 */
                if (!ath9k_hw_stoptxdma(ah, sc->beacon.beaconq)) {
-                       ath_print(common, ATH_DBG_FATAL,
-                               "beacon queue %u did not stop?\n", sc->beacon.beaconq);
+                       ath_err(common, "beacon queue %u did not stop?\n",
+                               sc->beacon.beaconq);
                }
 
                /* NB: cabq traffic should already be queued and primed */
 
        if (!ath9k_hw_use_flash(ah)) {
                if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET,
                                         &magic)) {
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "Reading Magic # failed\n");
+                       ath_err(common, "Reading Magic # failed\n");
                        return false;
                }
 
                                        eepdata++;
                                }
                        } else {
-                               ath_print(common, ATH_DBG_FATAL,
-                                         "Invalid EEPROM Magic. "
-                                         "endianness mismatch.\n");
+                               ath_err(common,
+                                       "Invalid EEPROM Magic. endianness mismatch.\n");
                                return -EINVAL;
                        }
                }
 
        if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR5416_EEP_VER ||
            ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
-                         sum, ah->eep_ops->get_eeprom_ver(ah));
+               ath_err(common, "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
+                       sum, ah->eep_ops->get_eeprom_ver(ah));
                return -EINVAL;
        }
 
 
        if (!ath9k_hw_use_flash(ah)) {
                if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET,
                                         &magic)) {
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "Reading Magic # failed\n");
+                       ath_err(common, "Reading Magic # failed\n");
                        return false;
                }
 
                                        eepdata++;
                                }
                        } else {
-                               ath_print(common, ATH_DBG_FATAL,
-                                         "Invalid EEPROM Magic. "
-                                         "Endianness mismatch.\n");
+                               ath_err(common,
+                                       "Invalid EEPROM Magic. Endianness mismatch.\n");
                                return -EINVAL;
                        }
                }
 
        if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR9287_EEP_VER
            || ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
-                          sum, ah->eep_ops->get_eeprom_ver(ah));
+               ath_err(common, "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
+                       sum, ah->eep_ops->get_eeprom_ver(ah));
                return -EINVAL;
        }
 
 
        for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) {
                if (!ath9k_hw_nvram_read(common, addr + ar5416_eep_start_loc,
                                         eep_data)) {
-                       ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
-                                 "Unable to read eeprom region\n");
+                       ath_err(ath9k_hw_common(ah),
+                               "Unable to read eeprom region\n");
                        return false;
                }
                eep_data++;
        int i, addr, size;
 
        if (!ath9k_hw_nvram_read(common, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
-               ath_print(common, ATH_DBG_FATAL, "Reading Magic # failed\n");
+               ath_err(common, "Reading Magic # failed\n");
                return false;
        }
 
                                        eepdata++;
                                }
                        } else {
-                               ath_print(common, ATH_DBG_FATAL,
-                                         "Invalid EEPROM Magic. "
-                                         "Endianness mismatch.\n");
+                               ath_err(common,
+                                       "Invalid EEPROM Magic. Endianness mismatch.\n");
                                return -EINVAL;
                        }
                }
 
        if (sum != 0xffff || ah->eep_ops->get_eeprom_ver(ah) != AR5416_EEP_VER ||
            ah->eep_ops->get_eeprom_rev(ah) < AR5416_EEP_NO_BACK_VER) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
+               ath_err(common, "Bad EEPROM checksum 0x%x or revision 0x%04x\n",
                        sum, ah->eep_ops->get_eeprom_ver(ah));
                return -EINVAL;
        }
 
 
        ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &led->led_cdev);
        if (ret)
-               ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
-                         "Failed to register led:%s", led->name);
+               ath_err(ath9k_hw_common(sc->sc_ah),
+                       "Failed to register led:%s", led->name);
        else
                led->registered = 1;
        return ret;
 
        qi.tqi_cwmax = qi_be.tqi_cwmax;
 
        if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) {
-               ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
-                         "Unable to update beacon queue %u!\n", qnum);
+               ath_err(ath9k_hw_common(ah),
+                       "Unable to update beacon queue %u!\n", qnum);
        } else {
                ath9k_hw_resettxqueue(ah, priv->beaconq);
        }
 
 
        priv->beaconq = ath9k_hw_beaconq_setup(priv->ah);
        if (priv->beaconq == -1) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to setup BEACON xmit queue\n");
+               ath_err(common, "Unable to setup BEACON xmit queue\n");
                goto err;
        }
 
        priv->cabq = ath9k_htc_cabq_setup(priv);
        if (priv->cabq == -1) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to setup CAB xmit queue\n");
+               ath_err(common, "Unable to setup CAB xmit queue\n");
                goto err;
        }
 
        if (!ath9k_htc_txq_setup(priv, WME_AC_BE)) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to setup xmit queue for BE traffic\n");
+               ath_err(common, "Unable to setup xmit queue for BE traffic\n");
                goto err;
        }
 
        if (!ath9k_htc_txq_setup(priv, WME_AC_BK)) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to setup xmit queue for BK traffic\n");
+               ath_err(common, "Unable to setup xmit queue for BK traffic\n");
                goto err;
        }
        if (!ath9k_htc_txq_setup(priv, WME_AC_VI)) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to setup xmit queue for VI traffic\n");
+               ath_err(common, "Unable to setup xmit queue for VI traffic\n");
                goto err;
        }
        if (!ath9k_htc_txq_setup(priv, WME_AC_VO)) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to setup xmit queue for VO traffic\n");
+               ath_err(common, "Unable to setup xmit queue for VO traffic\n");
                goto err;
        }
 
 
        ret = ath9k_hw_init(ah);
        if (ret) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to initialize hardware; "
-                         "initialization status: %d\n", ret);
+               ath_err(common,
+                       "Unable to initialize hardware; initialization status: %d\n",
+                       ret);
                goto err_hw;
        }
 
        ret = ath9k_htc_init_debug(ah);
        if (ret) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to create debugfs files\n");
+               ath_err(common, "Unable to create debugfs files\n");
                goto err_debug;
        }
 
 
        caldata = &priv->caldata[channel->hw_value];
        ret = ath9k_hw_reset(ah, hchan, caldata, fastcc);
        if (ret) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to reset channel (%u Mhz) "
-                         "reset status %d\n", channel->center_freq, ret);
+               ath_err(common,
+                       "Unable to reset channel (%u Mhz) reset status %d\n",
+                       channel->center_freq, ret);
                goto err;
        }
 
        WMI_CMD_BUF(WMI_NODE_CREATE_CMDID, &tsta);
        if (ret) {
                if (sta)
-                       ath_print(common, ATH_DBG_FATAL,
-                         "Unable to add station entry for: %pM\n", sta->addr);
+                       ath_err(common,
+                               "Unable to add station entry for: %pM\n",
+                               sta->addr);
                return ret;
        }
 
        WMI_CMD_BUF(WMI_NODE_REMOVE_CMDID, &sta_idx);
        if (ret) {
                if (sta)
-                       ath_print(common, ATH_DBG_FATAL,
-                         "Unable to remove station entry for: %pM\n",
-                         sta->addr);
+                       ath_err(common,
+                               "Unable to remove station entry for: %pM\n",
+                               sta->addr);
                return ret;
        }
 
 
        WMI_CMD_BUF(WMI_RC_RATE_UPDATE_CMDID, trate);
        if (ret) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to initialize Rate information on target\n");
+               ath_err(common,
+                       "Unable to initialize Rate information on target\n");
        }
 
        return ret;
 
        ret = led_classdev_register(wiphy_dev(priv->hw->wiphy), &led->led_cdev);
        if (ret)
-               ath_print(ath9k_hw_common(priv->ah), ATH_DBG_FATAL,
-                         "Failed to register led:%s", led->name);
+               ath_err(ath9k_hw_common(priv->ah),
+                       "Failed to register led:%s", led->name);
        else
                led->registered = 1;
 
        /* Reset the HW */
        ret = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
        if (ret) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to reset hardware; reset status %d "
-                         "(freq %u MHz)\n", ret, ah->curchan->channel);
+               ath_err(common,
+                       "Unable to reset hardware; reset status %d (freq %u MHz)\n",
+                       ret, ah->curchan->channel);
        }
 
        ath_update_txpow(priv);
        /* Reset the HW */
        ret = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
        if (ret) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to reset hardware; reset status %d "
-                         "(freq %u MHz)\n", ret, ah->curchan->channel);
+               ath_err(common,
+                       "Unable to reset hardware; reset status %d (freq %u MHz)\n",
+                       ret, ah->curchan->channel);
        }
 
        /* Disable the PHY */
        ath9k_hw_htc_resetinit(ah);
        ret = ath9k_hw_reset(ah, init_channel, ah->caldata, false);
        if (ret) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to reset hardware; reset status %d "
-                         "(freq %u MHz)\n", ret, curchan->center_freq);
+               ath_err(common,
+                       "Unable to reset hardware; reset status %d (freq %u MHz)\n",
+                       ret, curchan->center_freq);
                mutex_unlock(&priv->mutex);
                return ret;
        }
        /* Remove monitor interface here */
        if (ah->opmode == NL80211_IFTYPE_MONITOR) {
                if (ath9k_htc_remove_monitor_interface(priv))
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "Unable to remove monitor interface\n");
+                       ath_err(common, "Unable to remove monitor interface\n");
                else
                        ath_print(common, ATH_DBG_CONFIG,
                                  "Monitor interface removed\n");
                hvif.opmode = cpu_to_be32(HTC_M_IBSS);
                break;
        default:
-               ath_print(common, ATH_DBG_FATAL,
+               ath_err(common,
                        "Interface type %d not yet supported\n", vif->type);
                ret = -EOPNOTSUPP;
                goto out;
                                          hw->conf.channel_type);
 
                if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) {
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "Unable to set channel\n");
+                       ath_err(common, "Unable to set channel\n");
                        mutex_unlock(&priv->mutex);
                        return -EINVAL;
                }
        if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
                if (conf->flags & IEEE80211_CONF_MONITOR) {
                        if (ath9k_htc_add_monitor_interface(priv))
-                               ath_print(common, ATH_DBG_FATAL,
-                                         "Failed to set monitor mode\n");
+                               ath_err(common, "Failed to set monitor mode\n");
                        else
                                ath_print(common, ATH_DBG_CONFIG,
                                          "HW opmode set to Monitor mode\n");
 
        ret = ath_htc_txq_update(priv, qnum, &qi);
        if (ret) {
-               ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n");
+               ath_err(common, "TXQ Update failed\n");
                goto out;
        }
 
                spin_unlock_bh(&priv->tx_lock);
                break;
        default:
-               ath_print(ath9k_hw_common(priv->ah), ATH_DBG_FATAL,
-                         "Unknown AMPDU action\n");
+               ath_err(ath9k_hw_common(priv->ah), "Unknown AMPDU action\n");
        }
 
        return ret;
 
        qi.tqi_readyTime = qinfo->tqi_readyTime;
 
        if (!ath9k_hw_set_txq_props(ah, qnum, &qi)) {
-               ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
-                         "Unable to update hardware queue %u!\n", qnum);
+               ath_err(ath9k_hw_common(ah),
+                       "Unable to update hardware queue %u!\n", qnum);
                error = -EIO;
        } else {
                ath9k_hw_resettxqueue(ah, qnum);
                   (ep_id == priv->data_vo_ep)) {
                skb_pull(skb, sizeof(struct tx_frame_hdr));
        } else {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unsupported TX EPID: %d\n", ep_id);
+               ath_err(common, "Unsupported TX EPID: %d\n", ep_id);
                dev_kfree_skb_any(skb);
                return;
        }
                return false;
 
        if (qnum >= ARRAY_SIZE(priv->hwq_map)) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "qnum %u out of range, max %u!\n",
-                         qnum, (unsigned int)ARRAY_SIZE(priv->hwq_map));
+               ath_err(common, "qnum %u out of range, max %zu!\n",
+                       qnum, ARRAY_SIZE(priv->hwq_map));
                ath9k_hw_releasetxqueue(ah, qnum);
                return false;
        }
        __le16 fc;
 
        if (skb->len <= HTC_RX_FRAME_HEADER_SIZE) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Corrupted RX frame, dropping\n");
+               ath_err(common, "Corrupted RX frame, dropping\n");
                goto rx_next;
        }
 
 
        if (be16_to_cpu(rxstatus->rs_datalen) -
            (skb->len - HTC_RX_FRAME_HEADER_SIZE) != 0) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Corrupted RX data len, dropping "
-                         "(dlen: %d, skblen: %d)\n",
-                         rxstatus->rs_datalen, skb->len);
+               ath_err(common,
+                       "Corrupted RX data len, dropping (dlen: %d, skblen: %d)\n",
+                       rxstatus->rs_datalen, skb->len);
                goto rx_next;
        }
 
        for (i = 0; i < ATH9K_HTC_RXBUF; i++) {
                rxbuf = kzalloc(sizeof(struct ath9k_htc_rxbuf), GFP_KERNEL);
                if (rxbuf == NULL) {
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "Unable to allocate RX buffers\n");
+                       ath_err(common, "Unable to allocate RX buffers\n");
                        goto err;
                }
                list_add_tail(&rxbuf->list, &priv->rx.rxbuf);
 
                }
                break;
        default:
-               ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
-                         "Unknown phy %u (rate ix %u)\n", phy, rateix);
+               ath_err(ath9k_hw_common(ah),
+                       "Unknown phy %u (rate ix %u)\n", phy, rateix);
                txTime = 0;
                break;
        }
                        REG_WRITE(ah, addr, wrData);
                        rdData = REG_READ(ah, addr);
                        if (rdData != wrData) {
-                               ath_print(common, ATH_DBG_FATAL,
-                                         "address test failed "
-                                         "addr: 0x%08x - wr:0x%08x != "
-                                         "rd:0x%08x\n",
-                                         addr, wrData, rdData);
+                               ath_err(common,
+                                       "address test failed addr: 0x%08x - wr:0x%08x != rd:0x%08x\n",
+                                       addr, wrData, rdData);
                                return false;
                        }
                }
                        REG_WRITE(ah, addr, wrData);
                        rdData = REG_READ(ah, addr);
                        if (wrData != rdData) {
-                               ath_print(common, ATH_DBG_FATAL,
-                                         "address test failed "
-                                         "addr: 0x%08x - wr:0x%08x != "
-                                         "rd:0x%08x\n",
-                                         addr, wrData, rdData);
+                               ath_err(common,
+                                       "address test failed addr: 0x%08x - wr:0x%08x != rd:0x%08x\n",
+                                       addr, wrData, rdData);
                                return false;
                        }
                }
 
        ecode = ath9k_hw_rf_alloc_ext_banks(ah);
        if (ecode) {
-               ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
-                         "Failed allocating banks for "
-                         "external radio\n");
+               ath_err(ath9k_hw_common(ah),
+                       "Failed allocating banks for external radio\n");
                ath9k_hw_rf_free_ext_banks(ah);
                return ecode;
        }
                ah->hw_version.macVersion = AR_SREV_VERSION_9100;
 
        if (!ath9k_hw_set_reset_reg(ah, ATH9K_RESET_POWER_ON)) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Couldn't reset chip\n");
+               ath_err(common, "Couldn't reset chip\n");
                return -EIO;
        }
 
        ath9k_hw_attach_ops(ah);
 
        if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) {
-               ath_print(common, ATH_DBG_FATAL, "Couldn't wakeup chip\n");
+               ath_err(common, "Couldn't wakeup chip\n");
                return -EIO;
        }
 
                ah->config.max_txtrig_level = MAX_TX_FIFO_THRESHOLD;
 
        if (!ath9k_hw_macversion_supported(ah)) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Mac Chip Rev 0x%02x.%x is not supported by "
-                         "this driver\n", ah->hw_version.macVersion,
-                         ah->hw_version.macRev);
+               ath_err(common,
+                       "Mac Chip Rev 0x%02x.%x is not supported by this driver\n",
+                       ah->hw_version.macVersion, ah->hw_version.macRev);
                return -EOPNOTSUPP;
        }
 
 
        r = ath9k_hw_init_macaddr(ah);
        if (r) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Failed to initialize MAC address\n");
+               ath_err(common, "Failed to initialize MAC address\n");
                return r;
        }
 
        default:
                if (common->bus_ops->ath_bus_type == ATH_USB)
                        break;
-               ath_print(common, ATH_DBG_FATAL,
-                         "Hardware device ID 0x%04x not supported\n",
-                         ah->hw_version.devid);
+               ath_err(common, "Hardware device ID 0x%04x not supported\n",
+                       ah->hw_version.devid);
                return -EOPNOTSUPP;
        }
 
        ret = __ath9k_hw_init(ah);
        if (ret) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to initialize hardware; "
-                         "initialization status: %d\n", ret);
+               ath_err(common,
+                       "Unable to initialize hardware; initialization status: %d\n",
+                       ret);
                return ret;
        }
 
        }
 
        if (!ath9k_hw_rfbus_req(ah)) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Could not kill baseband RX\n");
+               ath_err(common, "Could not kill baseband RX\n");
                return false;
        }
 
 
        r = ath9k_hw_rf_set_freq(ah, chan);
        if (r) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Failed to set channel\n");
+               ath_err(common, "Failed to set channel\n");
                return false;
        }
        ath9k_hw_set_clockrate(ah);
        }
 
        if (!ath9k_hw_chip_reset(ah, chan)) {
-               ath_print(common, ATH_DBG_FATAL, "Chip reset failed\n");
+               ath_err(common, "Chip reset failed\n");
                return -EINVAL;
        }
 
                                    AR_RTC_FORCE_WAKE_EN);
                }
                if (i == 0) {
-                       ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
-                                 "Failed to wakeup in %uus\n",
-                                 POWER_UP_TIME / 20);
+                       ath_err(ath9k_hw_common(ah),
+                               "Failed to wakeup in %uus\n",
+                               POWER_UP_TIME / 20);
                        return false;
                }
        }
                ath9k_set_power_network_sleep(ah, setChip);
                break;
        default:
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unknown power mode %u\n", mode);
+               ath_err(common, "Unknown power mode %u\n", mode);
                return false;
        }
        ah->power_mode = mode;
 
        eeval = ah->eep_ops->get_eeprom(ah, EEP_OP_MODE);
        if ((eeval & (AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A)) == 0) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "no band has been marked as supported in EEPROM.\n");
+               ath_err(common,
+                       "no band has been marked as supported in EEPROM\n");
                return -EINVAL;
        }
 
        timer = kzalloc(sizeof(struct ath_gen_timer), GFP_KERNEL);
 
        if (timer == NULL) {
-               ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
-                         "Failed to allocate memory"
-                         "for hw timer[%d]\n", timer_index);
+               ath_err(ath9k_hw_common(ah),
+                       "Failed to allocate memory for hw timer[%d]\n",
+                       timer_index);
                return NULL;
        }
 
 
 
        /* ath_desc must be a multiple of DWORDs */
        if ((desc_len % 4) != 0) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "ath_desc not DWORD aligned\n");
+               ath_err(common, "ath_desc not DWORD aligned\n");
                BUG_ON((desc_len % 4) != 0);
                error = -ENOMEM;
                goto fail;
 
        error = ath9k_init_debug(ah);
        if (error) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to create debugfs files\n");
+               ath_err(common, "Unable to create debugfs files\n");
                goto error_world;
        }
 
 
                wait = wait_time;
                while (ath9k_hw_numtxpending(ah, q)) {
                        if ((--wait) == 0) {
-                               ath_print(common, ATH_DBG_FATAL,
-                                         "Failed to stop TX DMA in 100 "
-                                         "msec after killing last frame\n");
+                               ath_err(common,
+                                       "Failed to stop TX DMA in 100 msec after killing last frame\n");
                                break;
                        }
                        udelay(ATH9K_TIME_QUANTUM);
                            ATH9K_TX_QUEUE_INACTIVE)
                                break;
                if (q == pCap->total_queues) {
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "No available TX queue\n");
+                       ath_err(common, "No available TX queue\n");
                        return -1;
                }
                break;
        default:
-               ath_print(common, ATH_DBG_FATAL,
-                         "Invalid TX queue type: %u\n", type);
+               ath_err(common, "Invalid TX queue type: %u\n", type);
                return -1;
        }
 
 
        qi = &ah->txq[q];
        if (qi->tqi_type != ATH9K_TX_QUEUE_INACTIVE) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "TX queue: %u already active\n", q);
+               ath_err(common, "TX queue: %u already active\n", q);
                return -1;
        }
        memset(qi, 0, sizeof(struct ath9k_tx_queue_info));
                                     AR_DIAG_RX_ABORT));
 
                        reg = REG_READ(ah, AR_OBS_BUS_1);
-                       ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
-                                 "RX failed to go idle in 10 ms RXSM=0x%x\n",
-                                 reg);
+                       ath_err(ath9k_hw_common(ah),
+                               "RX failed to go idle in 10 ms RXSM=0x%x\n",
+                               reg);
 
                        return false;
                }
        }
 
        if (i == 0) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "DMA failed to stop in %d ms "
-                         "AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
-                         AH_RX_STOP_DMA_TIMEOUT / 1000,
-                         REG_READ(ah, AR_CR),
-                         REG_READ(ah, AR_DIAG_SW));
+               ath_err(common,
+                       "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
+                       AH_RX_STOP_DMA_TIMEOUT / 1000,
+                       REG_READ(ah, AR_CR),
+                       REG_READ(ah, AR_DIAG_SW));
                return false;
        } else {
                return true;
 
 
        r = ath9k_hw_reset(ah, hchan, caldata, fastcc);
        if (r) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to reset channel (%u MHz), "
-                         "reset status %d\n",
-                         channel->center_freq, r);
+               ath_err(common,
+                       "Unable to reset channel (%u MHz), reset status %d\n",
+                       channel->center_freq, r);
                goto ps_restore;
        }
 
        if (ath_startrecv(sc) != 0) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to restart recv logic\n");
+               ath_err(common, "Unable to restart recv logic\n");
                r = -EIO;
                goto ps_restore;
        }
 
        r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
        if (r) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to reset channel (%u MHz), "
-                         "reset status %d\n",
-                         channel->center_freq, r);
+               ath_err(common,
+                       "Unable to reset channel (%u MHz), reset status %d\n",
+                       channel->center_freq, r);
        }
 
        ath_update_txpow(sc);
        if (ath_startrecv(sc) != 0) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to restart recv logic\n");
+               ath_err(common, "Unable to restart recv logic\n");
                spin_unlock_bh(&sc->sc_pcu_lock);
                return;
        }
 
        r = ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
        if (r) {
-               ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
-                         "Unable to reset channel (%u MHz), "
-                         "reset status %d\n",
-                         channel->center_freq, r);
+               ath_err(ath9k_hw_common(sc->sc_ah),
+                       "Unable to reset channel (%u MHz), reset status %d\n",
+                       channel->center_freq, r);
        }
 
        ath9k_hw_phy_disable(ah);
 
        r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false);
        if (r)
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to reset hardware; reset status %d\n", r);
+               ath_err(common,
+                       "Unable to reset hardware; reset status %d\n", r);
 
        if (ath_startrecv(sc) != 0)
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to start recv logic\n");
+               ath_err(common, "Unable to start recv logic\n");
 
        /*
         * We may be doing a reset in response to a request
        spin_lock_bh(&sc->sc_pcu_lock);
        r = ath9k_hw_reset(ah, init_channel, ah->caldata, false);
        if (r) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to reset hardware; reset status %d "
-                         "(freq %u MHz)\n", r,
-                         curchan->center_freq);
+               ath_err(common,
+                       "Unable to reset hardware; reset status %d (freq %u MHz)\n",
+                       r, curchan->center_freq);
                spin_unlock_bh(&sc->sc_pcu_lock);
                goto mutex_unlock;
        }
         * here except setup the interrupt mask.
         */
        if (ath_startrecv(sc) != 0) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Unable to start recv logic\n");
+               ath_err(common, "Unable to start recv logic\n");
                r = -EIO;
                spin_unlock_bh(&sc->sc_pcu_lock);
                goto mutex_unlock;
                ic_opmode = vif->type;
                break;
        default:
-               ath_print(common, ATH_DBG_FATAL,
-                       "Interface type %d not yet supported\n", vif->type);
+               ath_err(common, "Interface type %d not yet supported\n",
+                       vif->type);
                ret = -EOPNOTSUPP;
                goto out;
        }
                }
 
                if (ath_set_channel(sc, hw, &sc->sc_ah->channels[pos]) < 0) {
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "Unable to set channel\n");
+                       ath_err(common, "Unable to set channel\n");
                        mutex_unlock(&sc->mutex);
                        return -EINVAL;
                }
 
        ret = ath_txq_update(sc, txq->axq_qnum, &qi);
        if (ret)
-               ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n");
+               ath_err(common, "TXQ Update failed\n");
 
        if (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC)
                if (queue == WME_AC_BE && !ret)
                ath9k_ps_restore(sc);
                break;
        default:
-               ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
-                         "Unknown AMPDU action\n");
+               ath_err(ath9k_hw_common(sc->sc_ah), "Unknown AMPDU action\n");
        }
 
        local_bh_enable();
 
 
        if (pdata) {
                if (off >= (ARRAY_SIZE(pdata->eeprom_data))) {
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "%s: eeprom read failed, offset %08x "
-                                 "is out of range\n",
-                                 __func__, off);
+                       ath_err(common,
+                               "%s: eeprom read failed, offset %08x is out of range\n",
+                               __func__, off);
                }
 
                *data = pdata->eeprom_data[off];
 
 
        rate_priv = kzalloc(sizeof(struct ath_rate_priv), gfp);
        if (!rate_priv) {
-               ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
-                         "Unable to allocate private rc structure\n");
+               ath_err(ath9k_hw_common(sc->sc_ah),
+                       "Unable to allocate private rc structure\n");
                return NULL;
        }
 
 
                                dev_kfree_skb_any(skb);
                                bf->bf_mpdu = NULL;
                                bf->bf_buf_addr = 0;
-                               ath_print(common, ATH_DBG_FATAL,
+                               ath_err(common,
                                        "dma_mapping_error() on RX init\n");
                                error = -ENOMEM;
                                goto rx_init_fail;
                error = ath_descdma_setup(sc, &sc->rx.rxdma, &sc->rx.rxbuf,
                                "rx", nbufs, 1, 0);
                if (error != 0) {
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "failed to allocate rx descriptors: %d\n",
-                                 error);
+                       ath_err(common,
+                               "failed to allocate rx descriptors: %d\n",
+                               error);
                        goto err;
                }
 
                                dev_kfree_skb_any(skb);
                                bf->bf_mpdu = NULL;
                                bf->bf_buf_addr = 0;
-                               ath_print(common, ATH_DBG_FATAL,
-                                         "dma_mapping_error() on RX init\n");
+                               ath_err(common,
+                                       "dma_mapping_error() on RX init\n");
                                error = -ENOMEM;
                                goto err;
                        }
                        dev_kfree_skb_any(requeue_skb);
                        bf->bf_mpdu = NULL;
                        bf->bf_buf_addr = 0;
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "dma_mapping_error() on RX\n");
+                       ath_err(common, "dma_mapping_error() on RX\n");
                        ath_rx_send_to_mac80211(hw, sc, skb, rxs);
                        break;
                }
 
                return NULL;
        }
        if (qnum >= ARRAY_SIZE(sc->tx.txq)) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "qnum %u out of range, max %u!\n",
-                         qnum, (unsigned int)ARRAY_SIZE(sc->tx.txq));
+               ath_err(common, "qnum %u out of range, max %zu!\n",
+                       qnum, ARRAY_SIZE(sc->tx.txq));
                ath9k_hw_releasetxqueue(ah, qnum);
                return NULL;
        }
        qi.tqi_readyTime = qinfo->tqi_readyTime;
 
        if (!ath9k_hw_set_txq_props(ah, qnum, &qi)) {
-               ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
-                         "Unable to update hardware queue %u!\n", qnum);
+               ath_err(ath9k_hw_common(sc->sc_ah),
+                       "Unable to update hardware queue %u!\n", qnum);
                error = -EIO;
        } else {
                ath9k_hw_resettxqueue(ah, qnum);
        if (npend) {
                int r;
 
-               ath_print(common, ATH_DBG_FATAL,
-                         "Failed to stop TX DMA. Resetting hardware!\n");
+               ath_err(common, "Failed to stop TX DMA. Resetting hardware!\n");
 
                r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false);
                if (r)
-                       ath_print(common, ATH_DBG_FATAL,
-                                 "Unable to reset hardware; reset status %d\n",
-                                 r);
+                       ath_err(common,
+                               "Unable to reset hardware; reset status %d\n",
+                               r);
        }
 
        for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
        if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) {
                bf->bf_mpdu = NULL;
                bf->bf_buf_addr = 0;
-               ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
-                         "dma_mapping_error() on TX\n");
+               ath_err(ath9k_hw_common(sc->sc_ah),
+                       "dma_mapping_error() on TX\n");
                ath_tx_return_buffer(sc, bf);
                return NULL;
        }
        error = ath_descdma_setup(sc, &sc->tx.txdma, &sc->tx.txbuf,
                                  "tx", nbufs, 1, 1);
        if (error != 0) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Failed to allocate tx descriptors: %d\n", error);
+               ath_err(common,
+                       "Failed to allocate tx descriptors: %d\n", error);
                goto err;
        }
 
        error = ath_descdma_setup(sc, &sc->beacon.bdma, &sc->beacon.bbuf,
                                  "beacon", ATH_BCBUF, 1, 1);
        if (error != 0) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "Failed to allocate beacon descriptors: %d\n", error);
+               ath_err(common,
+                       "Failed to allocate beacon descriptors: %d\n", error);
                goto err;
        }
 
 
        void *ah = common->ah;
 
        if (entry >= common->keymax) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "keychache entry %u out of range\n", entry);
+               ath_err(common, "keycache entry %u out of range\n", entry);
                return false;
        }
 
        void *ah = common->ah;
 
        if (entry >= common->keymax) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "keychache entry %u out of range\n", entry);
+               ath_err(common, "keycache entry %u out of range\n", entry);
                return false;
        }
 
        u32 keyType;
 
        if (entry >= common->keymax) {
-               ath_print(common, ATH_DBG_FATAL,
-                         "keycache entry %u out of range\n", entry);
+               ath_err(common, "keycache entry %u out of range\n", entry);
                return false;
        }
 
                keyType = AR_KEYTABLE_TYPE_CLR;
                break;
        default:
-               ath_print(common, ATH_DBG_FATAL,
-                         "cipher %u not supported\n", k->kv_type);
+               ath_err(common, "cipher %u not supported\n", k->kv_type);
                return false;
        }
 
        memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
        if (!ath_hw_set_keycache_entry(common, keyix, hk, NULL)) {
                /* TX MIC entry failed. No need to proceed further */
-               ath_print(common, ATH_DBG_FATAL,
-                         "Setting TX MIC Key Failed\n");
+               ath_err(common, "Setting TX MIC Key Failed\n");
                return 0;
        }