From: Nicolas Escande <nico.escande@gmail.com>
To: ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH ath-next] wifi: ath12k: unify error handling in some ath12k_wmi_xxx() functions
Date: Wed, 22 Apr 2026 18:32:07 +0200 [thread overview]
Message-ID: <20260422163208.3013496-1-nico.escande@gmail.com> (raw)
This is purely cosmetic changes that simplifies & standardizes error
handling for functions that ends with a ath12k_wmi_cmd_send() followed
by trivial error handling. Saves a few lines of code too.
Compile tested only.
Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
---
drivers/net/wireless/ath/ath12k/wmi.c | 32 +++++++--------------------
1 file changed, 8 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 350f249f5ba6..bfe4af76304c 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -4199,12 +4199,9 @@ int ath12k_wmi_pdev_lro_cfg(struct ath12k *ar,
if (ret) {
ath12k_warn(ar->ab,
"failed to send lro cfg req wmi cmd\n");
- goto err;
+ dev_kfree_skb(skb);
}
- return 0;
-err:
- dev_kfree_skb(skb);
return ret;
}
@@ -4335,12 +4332,9 @@ int ath12k_wmi_vdev_spectral_conf(struct ath12k *ar,
if (ret) {
ath12k_warn(ar->ab,
"failed to send spectral scan config wmi cmd\n");
- goto err;
+ dev_kfree_skb(skb);
}
- return 0;
-err:
- dev_kfree_skb(skb);
return ret;
}
@@ -4372,12 +4366,9 @@ int ath12k_wmi_vdev_spectral_enable(struct ath12k *ar, u32 vdev_id,
if (ret) {
ath12k_warn(ar->ab,
"failed to send spectral enable wmi cmd\n");
- goto err;
+ dev_kfree_skb(skb);
}
- return 0;
-err:
- dev_kfree_skb(skb);
return ret;
}
@@ -4418,12 +4409,9 @@ int ath12k_wmi_pdev_dma_ring_cfg(struct ath12k *ar,
if (ret) {
ath12k_warn(ar->ab,
"failed to send dma ring cfg req wmi cmd\n");
- goto err;
+ dev_kfree_skb(skb);
}
- return 0;
-err:
- dev_kfree_skb(skb);
return ret;
}
@@ -10874,10 +10862,9 @@ int ath12k_wmi_mlo_setup(struct ath12k *ar, struct wmi_mlo_setup_arg *mlo_params
ath12k_warn(ar->ab, "failed to submit WMI_MLO_SETUP_CMDID command: %d\n",
ret);
dev_kfree_skb(skb);
- return ret;
}
- return 0;
+ return ret;
}
int ath12k_wmi_mlo_ready(struct ath12k *ar)
@@ -10902,10 +10889,9 @@ int ath12k_wmi_mlo_ready(struct ath12k *ar)
ath12k_warn(ar->ab, "failed to submit WMI_MLO_READY_CMDID command: %d\n",
ret);
dev_kfree_skb(skb);
- return ret;
}
- return 0;
+ return ret;
}
int ath12k_wmi_mlo_teardown(struct ath12k *ar)
@@ -10931,10 +10917,9 @@ int ath12k_wmi_mlo_teardown(struct ath12k *ar)
ath12k_warn(ar->ab, "failed to submit WMI MLO teardown command: %d\n",
ret);
dev_kfree_skb(skb);
- return ret;
}
- return 0;
+ return ret;
}
bool ath12k_wmi_supports_6ghz_cc_ext(struct ath12k *ar)
@@ -10997,10 +10982,9 @@ int ath12k_wmi_send_vdev_set_tpc_power(struct ath12k *ar,
if (ret) {
ath12k_warn(ar->ab, "failed to send WMI_VDEV_SET_TPC_POWER_CMDID\n");
dev_kfree_skb(skb);
- return ret;
}
- return 0;
+ return ret;
}
static int
--
2.53.0
next reply other threads:[~2026-04-22 16:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 16:32 Nicolas Escande [this message]
2026-04-27 11:56 ` [PATCH ath-next] wifi: ath12k: unify error handling in some ath12k_wmi_xxx() functions Vasanthakumar Thiagarajan
2026-04-28 2:42 ` Baochen Qiang
2026-04-30 21:30 ` Jeff Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260422163208.3013496-1-nico.escande@gmail.com \
--to=nico.escande@gmail.com \
--cc=ath12k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox