]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/infiniband/hw/hns/hns_roce_main.c
Merge tag 'for-next-dma_ops' of git://git.kernel.org/pub/scm/linux/kernel/git/dledfor...
[karo-tx-linux.git] / drivers / infiniband / hw / hns / hns_roce_main.c
index 0669377491441c98b360641c379b5bb65e057f79..c3b41f95e70a5f1c39e89d91e48653fc05e2b20a 100644 (file)
@@ -32,6 +32,7 @@
  */
 #include <linux/acpi.h>
 #include <linux/of_platform.h>
+#include <linux/module.h>
 #include <rdma/ib_addr.h>
 #include <rdma/ib_smi.h>
 #include <rdma/ib_user_verbs.h>
@@ -249,7 +250,7 @@ static int hns_roce_query_port(struct ib_device *ib_dev, u8 port_num,
        assert(port_num > 0);
        port = port_num - 1;
 
-       memset(props, 0, sizeof(*props));
+       /* props being zeroed by the caller, avoid zeroing it here */
 
        props->max_mtu = hr_dev->caps.max_mtu;
        props->gid_tbl_len = hr_dev->caps.gid_table_len[port];
@@ -400,14 +401,15 @@ static int hns_roce_port_immutable(struct ib_device *ib_dev, u8 port_num,
        struct ib_port_attr attr;
        int ret;
 
-       ret = hns_roce_query_port(ib_dev, port_num, &attr);
+       immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE;
+
+       ret = ib_query_port(ib_dev, port_num, &attr);
        if (ret)
                return ret;
 
        immutable->pkey_tbl_len = attr.pkey_tbl_len;
        immutable->gid_tbl_len = attr.gid_tbl_len;
 
-       immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE;
        immutable->max_mad_size = IB_MGMT_MAD_SIZE;
 
        return 0;