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 <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Sujith Manoharan
2012-11-19 14:24:46 +05:30
committed by John W. Linville
parent 57527f8d4d
commit ac46ba4384
3 changed files with 50 additions and 20 deletions

View File

@@ -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);