Re: [PATCH v3 07/34] iommu: Add probe_device() and release_device() call-backs

Hillf Danton
2020-07-04T09:19:54Z

On Wed, 29 Apr 2020 15:36:45 +0200 Joerg Roedel wrote:
>
> +static int __iommu_probe_device(struct device *dev)
> +{
> + const struct iommu_ops *ops = dev->bus->iommu_ops;
> + struct iommu_device *iommu_dev;
> + struct iommu_group *group;
> + int ret;
> +
> + iommu_dev = ops->probe_device(dev);
> + if (IS_ERR(iommu_dev))
> + return PTR_ERR(iommu_dev);
> +
> + dev->iommu->iommu_dev = iommu_dev;
> +
> + group = iommu_group_get_for_dev(dev);
> + if (!IS_ERR(group)) {

Typo?

> + ret = PTR_ERR(group);
> + goto out_release;
> + }
> + iommu_group_put(group);
> +
> + iommu_device_link(iommu_dev, dev);
> +
> + return 0;
> +
> +out_release:
> + ops->release_device(dev);
> +
> + return ret;
> +}