On Fri, Sep 04, 2020 at 06:22:12PM +0200, Auger Eric wrote:
> > +/**
> > + * virt_dma_configure - Configure DMA of virtualized devices
> > + * @dev: the endpoint
> > + *
> > + * Setup the DMA and IOMMU ops of a virtual device, for platforms without 
> > DT or
> > + * ACPI.
> > + *
> > + * Return: -EPROBE_DEFER if the device is managed by an IOMMU that hasn't 
> > been
> > + *   probed yet, 0 otherwise
> > + */
> > +int virt_dma_configure(struct device *dev)
> > +{
> > +   const struct iommu_ops *iommu_ops;
> > +
> > +   iommu_ops = virt_iommu_setup(dev);
> > +   if (IS_ERR_OR_NULL(iommu_ops)) {
> > +           int ret = PTR_ERR(iommu_ops);
> > +
> > +           if (ret == -EPROBE_DEFER || ret == 0)
> > +                   return ret;
> > +           dev_err(dev, "error %d while setting up virt IOMMU\n", ret);
> > +           return 0;
> why do we return 0 here?

So we can fall back to another method (ACPI or DT) if available

> Besides
> 
> Reviewed-by: Eric Auger <eric.au...@redhat.com>

Thanks!
Jean
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to