|
@@ -189,22 +189,27 @@ static ssize_t write_file_tx99(struct file *file, const char __user *user_buf,
|
|
if (strtobool(buf, &start))
|
|
if (strtobool(buf, &start))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ mutex_lock(&sc->mutex);
|
|
|
|
+
|
|
if (start == sc->tx99_state) {
|
|
if (start == sc->tx99_state) {
|
|
if (!start)
|
|
if (!start)
|
|
- return count;
|
|
|
|
|
|
+ goto out;
|
|
ath_dbg(common, XMIT, "Resetting TX99\n");
|
|
ath_dbg(common, XMIT, "Resetting TX99\n");
|
|
ath9k_tx99_deinit(sc);
|
|
ath9k_tx99_deinit(sc);
|
|
}
|
|
}
|
|
|
|
|
|
if (!start) {
|
|
if (!start) {
|
|
ath9k_tx99_deinit(sc);
|
|
ath9k_tx99_deinit(sc);
|
|
- return count;
|
|
|
|
|
|
+ goto out;
|
|
}
|
|
}
|
|
|
|
|
|
r = ath9k_tx99_init(sc);
|
|
r = ath9k_tx99_init(sc);
|
|
- if (r)
|
|
|
|
|
|
+ if (r) {
|
|
|
|
+ mutex_unlock(&sc->mutex);
|
|
return r;
|
|
return r;
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+out:
|
|
|
|
+ mutex_unlock(&sc->mutex);
|
|
return count;
|
|
return count;
|
|
}
|
|
}
|
|
|
|
|