diff mbox

[rdma-next,v3] RDMA/ipoib: Fix return code from ipoib_cm_dev_init

Message ID 20180709192103.6936-1-kamalheib1@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Kamal Heib July 9, 2018, 7:21 p.m. UTC
The proper return code is -EOPNOTSUPP and not -ENOSYS when the function
isn't supported, also make sure to return the right error code
from ipoib_transport_dev_init() when ipoib_cm_dev_init() is supported.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
Changes from v2:
- Make sure to return the right error code from ipoib_transport_dev_init()

 drivers/infiniband/ulp/ipoib/ipoib.h       | 2 +-
 drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Jason Gunthorpe July 9, 2018, 9:20 p.m. UTC | #1
On Mon, Jul 09, 2018 at 10:21:03PM +0300, Kamal Heib wrote:
> The proper return code is -EOPNOTSUPP and not -ENOSYS when the function
> isn't supported, also make sure to return the right error code
> from ipoib_transport_dev_init() when ipoib_cm_dev_init() is supported.
> 
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> ---
> Changes from v2:
> - Make sure to return the right error code from ipoib_transport_dev_init()
> 
>  drivers/infiniband/ulp/ipoib/ipoib.h       | 2 +-
>  drivers/infiniband/ulp/ipoib/ipoib_verbs.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

Applied to for-next, thanks

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index a50b062ed13e..c7b7edc409e4 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -729,7 +729,7 @@  void ipoib_cm_dev_stop(struct net_device *dev)
 static inline
 int ipoib_cm_dev_init(struct net_device *dev)
 {
-	return -ENOSYS;
+	return -EOPNOTSUPP;
 }
 
 static inline
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
index ba4669f24014..8f929f094b2c 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
@@ -168,8 +168,8 @@  int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
 		else
 			size += ipoib_recvq_size * ipoib_max_conn_qp;
 	} else
-		if (ret != -ENOSYS)
-			return -ENODEV;
+		if (ret != -EOPNOTSUPP)
+			return ret;
 
 	req_vec = (priv->port - 1) * 2;