diff options
author | Dennis Dalessandro <dennis.dalessandro@intel.com> | 2016-01-06 21:02:52 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-03-11 04:37:11 +0300 |
commit | aec5778775ac03ee6cfd6480adbbf6b05513d77b (patch) | |
tree | a5ad1f53c61b582de0130839f7c45d7be0c2ddff /drivers/infiniband/sw | |
parent | ca889e8ad3af9f1dfeb827356bc9839fb20f32be (diff) | |
download | linux-aec5778775ac03ee6cfd6480adbbf6b05513d77b.tar.xz |
IB/rdmavt: Move driver helper functions to a common structure
Drivers are going to need to provide multiple functions for rdmavt to
call in to. We already have one, so go ahead and push this into a
data structure designated for driver supplied functions.
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')
-rw-r--r-- | drivers/infiniband/sw/rdmavt/vt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c index 367bc45e06e7..b4ce97e6ff12 100644 --- a/drivers/infiniband/sw/rdmavt/vt.c +++ b/drivers/infiniband/sw/rdmavt/vt.c @@ -280,8 +280,12 @@ 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; + /* We are now good to announce we exist */ - return ib_register_device(&rdi->ibdev, rdi->port_callback); + return ib_register_device(&rdi->ibdev, rdi->driver_f.port_callback); } EXPORT_SYMBOL(rvt_register_device); |