Skip to content

Commit

Permalink
RDMA/core: Fix return code when modify_device isn't supported
Browse files Browse the repository at this point in the history
The proper return code is "-EOPNOTSUPP" when modify_device callback is not
supported.

Link: https://lore.kernel.org/r/20190923104158.5331-2-kamalheib1@gmail.com
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Kamal Heib authored and Jason Gunthorpe committed Oct 1, 2019
1 parent 050dbdd commit d0f3ef3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/infiniband/core/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -2365,7 +2365,7 @@ int ib_modify_device(struct ib_device *device,
struct ib_device_modify *device_modify)
{
if (!device->ops.modify_device)
return -ENOSYS;
return -EOPNOTSUPP;

return device->ops.modify_device(device, device_modify_mask,
device_modify);
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/core/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ static ssize_t node_desc_store(struct device *device,
int ret;

if (!dev->ops.modify_device)
return -EIO;
return -EOPNOTSUPP;

memcpy(desc.node_desc, buf, min_t(int, count, IB_DEVICE_NODE_DESC_MAX));
ret = ib_modify_device(dev, IB_DEVICE_MODIFY_NODE_DESC, &desc);
Expand Down

0 comments on commit d0f3ef3

Please sign in to comment.