From ac46ba4384d2c44c56702d0da591696045fba682 Mon Sep 17 00:00:00 2001 From: Sujith Manoharan Date: Mon, 19 Nov 2012 14:24:46 +0530 Subject: ath9k: Fix BTCOEX debugfs file usage The debugfs file for dumping btcoex parameters unconditionally assumes a MCI-based device. This will not work for older btcoex chips. Fix this by branching out the routine into separate functions. Signed-off-by: Sujith Manoharan Signed-off-by: John W. Linville --- drivers/net/wireless/ath/ath9k/debug.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/net/wireless/ath/ath9k/debug.c') diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index a8be94b2a53a..585aee47860c 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c @@ -1599,8 +1599,14 @@ static ssize_t read_file_btcoex(struct file *file, char __user *user_buf, if (buf == NULL) return -ENOMEM; - len = ath9k_dump_btcoex(sc, buf, len, size); + if (!sc->sc_ah->common.btcoex_enabled) { + len = snprintf(buf, size, "%s\n", + "BTCOEX is disabled"); + goto exit; + } + len = ath9k_dump_btcoex(sc, buf, size); +exit: retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); kfree(buf); -- cgit v1.2.2