diff options
author | Bart Van Assche <bvanassche@acm.org> | 2011-06-18 16:35:42 (GMT) |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-07-18 23:44:30 (GMT) |
commit | 10e1b54bbb51ac134c51996022f3bd10579fbd3b (patch) | |
tree | 6b535275efbefb7f32d6bec89c21a05a902f655d /drivers/infiniband/core/device.c | |
parent | 620917de59eeb934b9f8cf35cc2d95c1ac8ed0fc (diff) | |
download | linux-fsl-qoriq-10e1b54bbb51ac134c51996022f3bd10579fbd3b.tar.xz |
RDMA: Allow for NULL .modify_device() and .modify_port() methods
These methods don't make sense for iWARP devices, so rather than
forcing them to implement stubs, just return -ENOSYS in the core if
the hardware driver doesn't set .modify_device and/or .modify_port.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/core/device.c')
-rw-r--r-- | drivers/infiniband/core/device.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 4007f72..e711de4 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -627,6 +627,9 @@ int ib_modify_device(struct ib_device *device, int device_modify_mask, struct ib_device_modify *device_modify) { + if (!device->modify_device) + return -ENOSYS; + return device->modify_device(device, device_modify_mask, device_modify); } @@ -647,6 +650,9 @@ int ib_modify_port(struct ib_device *device, u8 port_num, int port_modify_mask, struct ib_port_modify *port_modify) { + if (!device->modify_port) + return -ENOSYS; + if (port_num < start_port(device) || port_num > end_port(device)) return -EINVAL; |