summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rdmavt/vt.c
diff options
context:
space:
mode:
authorDennis Dalessandro2016-01-06 19:02:59 +0100
committerDoug Ledford2016-03-11 02:37:11 +0100
commitb534875d5ab348fb9193692589e2ee82ae768e3a (patch)
tree680b69581da57c6cebf18eeecdcaa8ed2216459b /drivers/infiniband/sw/rdmavt/vt.c
parentIB/rdmavt: Move driver helper functions to a common structure (diff)
downloadkernel-qcow2-linux-b534875d5ab348fb9193692589e2ee82ae768e3a.tar.gz
kernel-qcow2-linux-b534875d5ab348fb9193692589e2ee82ae768e3a.tar.xz
kernel-qcow2-linux-b534875d5ab348fb9193692589e2ee82ae768e3a.zip
IB/rdmavt: Add device specific info prints
Follow hfi1's example for printing information about the driver and incorporate into rdmavt. This requires two new functions to be provided by the driver, one to get_card_name and one to get_pci_dev. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw/rdmavt/vt.c')
-rw-r--r--drivers/infiniband/sw/rdmavt/vt.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index b4ce97e6ff12..2a13e361c808 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -213,9 +213,18 @@ static int rvt_get_port_immutable(struct ib_device *ibdev, u8 port_num,
int rvt_register_device(struct rvt_dev_info *rdi)
{
+ /* Validate that drivers have provided the right information */
if (!rdi)
return -EINVAL;
+ if ((!rdi->driver_f.port_callback) ||
+ (!rdi->driver_f.get_card_name) ||
+ (!rdi->driver_f.get_pci_dev)) {
+ return -EINVAL;
+ }
+
+ /* Once we get past here we can use the rvt_pr macros */
+
/* Dev Ops */
CHECK_DRIVER_OVERRIDE(rdi, query_device);
CHECK_DRIVER_OVERRIDE(rdi, modify_device);
@@ -280,9 +289,7 @@ int rvt_register_device(struct rvt_dev_info *rdi)
spin_lock_init(&rdi->n_pds_lock);
rdi->n_pds_allocated = 0;
- /* Validate that drivers have provided the right functions */
- if (!rdi->driver_f.port_callback)
- return -EINVAL;
+ rvt_pr_info(rdi, "Registration with rdmavt done.\n");
/* We are now good to announce we exist */
return ib_register_device(&rdi->ibdev, rdi->driver_f.port_callback);