OSDN Git Service

RDMA/ipoib: Fix return code from ipoib_cm_dev_init
authorKamal Heib <kamalheib1@gmail.com>
Mon, 9 Jul 2018 19:21:03 +0000 (22:21 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 9 Jul 2018 21:19:08 +0000 (15:19 -0600)
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>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/ulp/ipoib/ipoib.h
drivers/infiniband/ulp/ipoib/ipoib_verbs.c

index 3dd130a..e255a7e 100644 (file)
@@ -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
index 8dbf305..9f36ca7 100644 (file)
@@ -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;