goto cleanup;
}
+ ret = rawdev->dev_id; /* return the rawdev id of new device */
+
rawdev->dev_ops = &skeleton_rawdev_ops;
rawdev->device = &vdev->device;
/* In case of invalid argument, selftest != 1; ignore other values */
ret = skeleton_rawdev_create(name, vdev, rte_socket_id());
- if (!ret) {
+ if (ret >= 0) {
/* In case command line argument for 'selftest' was passed;
* if invalid arguments were passed, execution continues but
* without selftest.
*/
if (selftest == 1)
- test_rawdev_skeldev();
+ test_rawdev_skeldev(ret);
}
/* Device instance created; Second instance not possible */
skeldev_init_once = 1;
- return ret;
+ return ret < 0 ? ret : 0;
}
static int
struct rte_rawdev *dev = &rte_rawdevs[dev_id];
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_selftest, -ENOTSUP);
- return (*dev->dev_ops->dev_selftest)();
+ return (*dev->dev_ops->dev_selftest)(dev_id);
}
int