ksmbd: use ib_device_get_netdev() instead of calling ops.get_netdev

ULPs are not supposed to call to ops.* directly.

Suggested-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
Namjae Jeon
2025-03-21 22:05:39 +09:00
committed by Steve French
parent 6171063e9d
commit 6955bfef8f

View File

@@ -2142,8 +2142,7 @@ static int smb_direct_ib_client_add(struct ib_device *ib_dev)
if (ib_dev->node_type != RDMA_NODE_IB_CA)
smb_direct_port = SMB_DIRECT_PORT_IWARP;
if (!ib_dev->ops.get_netdev ||
!rdma_frwr_is_supported(&ib_dev->attrs))
if (!rdma_frwr_is_supported(&ib_dev->attrs))
return 0;
smb_dev = kzalloc(sizeof(*smb_dev), KSMBD_DEFAULT_GFP);
@@ -2243,8 +2242,7 @@ bool ksmbd_rdma_capable_netdev(struct net_device *netdev)
for (i = 0; i < smb_dev->ib_dev->phys_port_cnt; i++) {
struct net_device *ndev;
ndev = smb_dev->ib_dev->ops.get_netdev(smb_dev->ib_dev,
i + 1);
ndev = ib_device_get_netdev(smb_dev->ib_dev, i + 1);
if (!ndev)
continue;