提交 d0f3ef36 编写于 作者: K Kamal Heib 提交者: Jason Gunthorpe

RDMA/core: Fix return code when modify_device isn't supported

The proper return code is "-EOPNOTSUPP" when modify_device callback is not
supported.

Link: https://lore.kernel.org/r/20190923104158.5331-2-kamalheib1@gmail.comSigned-off-by: NKamal Heib <kamalheib1@gmail.com>
Reviewed-by: NJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
上级 050dbddf
...@@ -2365,7 +2365,7 @@ int ib_modify_device(struct ib_device *device, ...@@ -2365,7 +2365,7 @@ int ib_modify_device(struct ib_device *device,
struct ib_device_modify *device_modify) struct ib_device_modify *device_modify)
{ {
if (!device->ops.modify_device) if (!device->ops.modify_device)
return -ENOSYS; return -EOPNOTSUPP;
return device->ops.modify_device(device, device_modify_mask, return device->ops.modify_device(device, device_modify_mask,
device_modify); device_modify);
......
...@@ -1268,7 +1268,7 @@ static ssize_t node_desc_store(struct device *device, ...@@ -1268,7 +1268,7 @@ static ssize_t node_desc_store(struct device *device,
int ret; int ret;
if (!dev->ops.modify_device) if (!dev->ops.modify_device)
return -EIO; return -EOPNOTSUPP;
memcpy(desc.node_desc, buf, min_t(int, count, IB_DEVICE_NODE_DESC_MAX)); 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); ret = ib_modify_device(dev, IB_DEVICE_MODIFY_NODE_DESC, &desc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册