On Thu, Jun 03, 2021 at 04:06:18AM +0800, kernel test robot wrote:
> >> drivers/acpi/scan.c:1540:26: error: no member named 'ops' in 'struct 
> >> iommu_fwspec'
>            return fwspec ? fwspec->ops : NULL;
>                            ~~~~~~  ^
> >> drivers/acpi/scan.c:1564:9: error: implicit declaration of function 
> >> 'iommu_probe_device' [-Werror,-Wimplicit-function-declaration]
>                    err = iommu_probe_device(dev);
>                          ^

These are only defined when CONFIG_IOMMU_API is set. IORT uses them inside
an #ifdef, I can do the same. Maybe moving these two functions to a new
drivers/acpi/iommu.c would be nicer, though.

Thanks,
Jean

>    2 errors generated.
> 
> 
> vim +1540 drivers/acpi/scan.c
> 
>   1535        
>   1536        static inline const struct iommu_ops 
> *acpi_iommu_fwspec_ops(struct device *dev)
>   1537        {
>   1538                struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
>   1539        
> > 1540                return fwspec ? fwspec->ops : NULL;
>   1541        }
>   1542        
>   1543        static const struct iommu_ops *acpi_iommu_configure_id(struct 
> device *dev,
>   1544                                                               const 
> u32 *id_in)
>   1545        {
>   1546                int err;
>   1547                const struct iommu_ops *ops;
>   1548        
>   1549                /*
>   1550                 * If we already translated the fwspec there is nothing 
> left to do,
>   1551                 * return the iommu_ops.
>   1552                 */
>   1553                ops = acpi_iommu_fwspec_ops(dev);
>   1554                if (ops)
>   1555                        return ops;
>   1556        
>   1557                err = iort_iommu_configure_id(dev, id_in);
>   1558        
>   1559                /*
>   1560                 * If we have reason to believe the IOMMU driver missed 
> the initial
>   1561                 * add_device callback for dev, replay it to get things 
> in order.
>   1562                 */
>   1563                if (!err && dev->bus && !device_iommu_mapped(dev))
> > 1564                        err = iommu_probe_device(dev);
>   1565        
>   1566                /* Ignore all other errors apart from EPROBE_DEFER */
>   1567                if (err == -EPROBE_DEFER) {
>   1568                        return ERR_PTR(err);
>   1569                } else if (err) {
>   1570                        dev_dbg(dev, "Adding to IOMMU failed: %d\n", 
> err);
>   1571                        return NULL;
>   1572                }
>   1573                return acpi_iommu_fwspec_ops(dev);
>   1574        }
>   1575        
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/[email protected]


_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to