/* Convert from struct device to struct vio_dev and pass to driver. dev->driver has already been set by generic code because vio_bus_match succeeded.  */
static int vio_bus_probe(struct device *dev)
/* Convert from struct device to struct vio_dev and pass to driver. dev->driver has already been set by generic code because vio_bus_match succeeded.  */
static int vio_bus_probe(struct device *dev)
{
	struct vio_dev *viodev = to_vio_dev(dev);
	struct vio_driver *viodrv = to_vio_driver(dev->driver);
	const struct vio_device_id *id;
	int error = -ENODEV;
	if (!viodrv->probe)
		return error;
	id = vio_match_device(viodrv->id_table, viodev);
	if (id) {
		memset(&viodev->cmo, 0, sizeof(viodev->cmo));
		if (firmware_has_feature(FW_FEATURE_CMO)) {
			error = vio_cmo_bus_probe(viodev);
			if (error)
				return error;
		}
		error = viodrv->probe(viodev, id);
		if (error && firmware_has_feature(FW_FEATURE_CMO))
			vio_cmo_bus_remove(viodev);
	}
	return error;
}