summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorKonrad Dybcio <konrad.dybcio@oss.qualcomm.com>2026-05-21 12:40:02 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2026-05-21 14:29:05 +0200
commitdd60fb487e55445656284dbc9dc0c865ff9fb34c (patch)
treea281ace80cbd8671299a00154e08aa7ae92356ff /drivers/thunderbolt/switch.c
parente241d98e04ef0513b78de2d87d8d1eb2993d9d34 (diff)
downloadlinux-next-dd60fb487e55445656284dbc9dc0c865ff9fb34c.tar.gz
linux-next-dd60fb487e55445656284dbc9dc0c865ff9fb34c.zip
thunderbolt: Require nhi->ops be valid
Because of how fundamental ops->init_interrupts() is, it no longer makes sense to consider cases where nhi->ops is NULL. Drop some boilerplate around it and add a single sanity-check in nhi_probe() instead. Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index a29b9887cd6b..a830c82bb905 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -251,7 +251,7 @@ static int nvm_authenticate(struct tb_switch *sw, bool auth_only)
sw->nvm->authenticating = true;
if (!tb_route(sw)) {
- if (nhi->ops && nhi->ops->pre_nvm_auth)
+ if (nhi->ops->pre_nvm_auth)
nhi->ops->pre_nvm_auth(nhi);
ret = nvm_authenticate_host_dma_port(sw);
} else {
@@ -2782,7 +2782,7 @@ static int tb_switch_add_dma_port(struct tb_switch *sw)
nvm_get_auth_status(sw, &status);
if (status) {
if (!tb_route(sw)) {
- if (nhi->ops && nhi->ops->post_nvm_auth)
+ if (nhi->ops->post_nvm_auth)
nhi->ops->post_nvm_auth(nhi);
}
return 0;
@@ -2799,7 +2799,7 @@ static int tb_switch_add_dma_port(struct tb_switch *sw)
/* Now we can allow root port to suspend again */
if (!tb_route(sw)) {
- if (nhi->ops && nhi->ops->post_nvm_auth)
+ if (nhi->ops->post_nvm_auth)
nhi->ops->post_nvm_auth(nhi);
}