Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / ath / ath6kl / debug.c
index 80f23e398acd91134ce3f149b82255b93f639a44..fe38b836cb2651a77726af4e3d7772b591d46427 100644 (file)
@@ -117,15 +117,15 @@ void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...)
        struct va_format vaf;
        va_list args;
 
-       if (!(debug_mask & mask))
-               return;
-
        va_start(args, fmt);
 
        vaf.fmt = fmt;
        vaf.va = &args;
 
-       ath6kl_printk(KERN_DEBUG, "%pV", &vaf);
+       if (debug_mask & mask)
+               ath6kl_printk(KERN_DEBUG, "%pV", &vaf);
+
+       trace_ath6kl_log_dbg(mask, &vaf);
 
        va_end(args);
 }
@@ -141,6 +141,10 @@ void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
 
                print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
        }
+
+       /* tracing code doesn't like null strings :/ */
+       trace_ath6kl_log_dbg_dump(msg ? msg : "", prefix ? prefix : "",
+                                 buf, len);
 }
 EXPORT_SYMBOL(ath6kl_dbg_dump);
 
@@ -1806,8 +1810,10 @@ int ath6kl_debug_init_fs(struct ath6kl *ar)
        debugfs_create_file("tgt_stats", S_IRUSR, ar->debugfs_phy, ar,
                            &fops_tgt_stats);
 
-       debugfs_create_file("credit_dist_stats", S_IRUSR, ar->debugfs_phy, ar,
-                           &fops_credit_dist_stats);
+       if (ar->hif_type == ATH6KL_HIF_TYPE_SDIO)
+               debugfs_create_file("credit_dist_stats", S_IRUSR,
+                                   ar->debugfs_phy, ar,
+                                   &fops_credit_dist_stats);
 
        debugfs_create_file("endpoint_stats", S_IRUSR | S_IWUSR,
                            ar->debugfs_phy, ar, &fops_endpoint_stats);