aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/rdma_vt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma/rdma_vt.h')
-rw-r--r--include/rdma/rdma_vt.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/rdma/rdma_vt.h b/include/rdma/rdma_vt.h
index e32facdd9fd3..065c9fbe6589 100644
--- a/include/rdma/rdma_vt.h
+++ b/include/rdma/rdma_vt.h
@@ -429,7 +429,14 @@ static inline void rvt_set_ibdev_name(struct rvt_dev_info *rdi,
const char *fmt, const char *name,
const int unit)
{
- snprintf(rdi->ibdev.name, sizeof(rdi->ibdev.name), fmt, name, unit);
+ /*
+ * FIXME: rvt and its users want to touch the ibdev before
+ * registration and have things like the name work. We don't have the
+ * infrastructure in the core to support this directly today, hack it
+ * to work by setting the name manually here.
+ */
+ dev_set_name(&rdi->ibdev.dev, fmt, name, unit);
+ strlcpy(rdi->ibdev.name, dev_name(&rdi->ibdev.dev), IB_DEVICE_NAME_MAX);
}
/**