host-drivers/base-driver/vca/vop/vop_vringh.c
static inline int vop_card_virtio_dev_inited(struct vop_card_virtio_dev *vdev)
{
	if (!vdev)
		return -EINVAL;
	/* Device has not been created yet */
	if (!vdev->dd || !vdev->dd->type) {
		dev_err(vop_dev(vdev), "%s %d err %d\n",
			__func__, __LINE__, -EINVAL);
		return -EINVAL;
	}
	/* Device has been removed/deleted */
	if (vdev->dd->type == -1) {
		dev_dbg(vop_dev(vdev), "%s %d err %d\n",
			__func__, __LINE__, -ENODEV);
		return -ENODEV;
	}
	return 0;
}
/* Helper API to check if a virtio device is initialized */
Helper API to check if a virtio device is initialized
Helper API to check if a virtio device is initialized
static inline int vop_card_virtio_dev_inited(struct vop_card_virtio_dev *vdev)
{
	if (!vdev)
		return -EINVAL;
	if (!vdev->dd || !vdev->dd->type) {
		dev_err(vop_dev(vdev), "%s %d err %d\n",
			__func__, __LINE__, -EINVAL);
		return -EINVAL;
	}
	if (vdev->dd->type == -1) {
		dev_dbg(vop_dev(vdev), "%s %d err %d\n",
			__func__, __LINE__, -ENODEV);
		return -ENODEV;
	}
	return 0;
}
static inline int vop_card_virtio_dev_inited ( struct vop_card_virtio_dev * vdev ) { if ( ! vdev ) return - EINVAL ; if ( ! vdev -> dd || ! vdev -> dd -> type ) { dev_err ( vop_dev ( vdev ) , " \n " , __func__ , __LINE__ , - EINVAL ) ; return - EINVAL ; } if ( vdev -> dd -> type == -1 ) { dev_dbg ( vop_dev ( vdev ) , " \n " , __func__ , __LINE__ , - ENODEV ) ; return - ENODEV ; } return 0 ; }
Helper API to check if a virtio device is initialized
Helper API to check if a virtio device is initialized
/* Device has not been created yet */ /* Device has been removed/deleted */