@@ -1588,26 +1588,14 @@ int acpi_iommu_fwspec_init(struct device *dev, u32 id,
1588
1588
return iommu_fwspec_add_ids (dev , & id , 1 );
1589
1589
}
1590
1590
1591
- static inline const struct iommu_ops * acpi_iommu_fwspec_ops (struct device * dev )
1592
- {
1593
- struct iommu_fwspec * fwspec = dev_iommu_fwspec_get (dev );
1594
-
1595
- return fwspec ? fwspec -> ops : NULL ;
1596
- }
1597
-
1598
1591
static int acpi_iommu_configure_id (struct device * dev , const u32 * id_in )
1599
1592
{
1600
1593
int err ;
1601
- const struct iommu_ops * ops ;
1602
1594
1603
1595
/* Serialise to make dev->iommu stable under our potential fwspec */
1604
1596
mutex_lock (& iommu_probe_device_lock );
1605
- /*
1606
- * If we already translated the fwspec there is nothing left to do,
1607
- * return the iommu_ops.
1608
- */
1609
- ops = acpi_iommu_fwspec_ops (dev );
1610
- if (ops ) {
1597
+ /* If we already translated the fwspec there is nothing left to do */
1598
+ if (dev_iommu_fwspec_get (dev )) {
1611
1599
mutex_unlock (& iommu_probe_device_lock );
1612
1600
return 0 ;
1613
1601
}
@@ -1624,15 +1612,7 @@ static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in)
1624
1612
if (!err && dev -> bus )
1625
1613
err = iommu_probe_device (dev );
1626
1614
1627
- if (err == - EPROBE_DEFER )
1628
- return err ;
1629
- if (err ) {
1630
- dev_dbg (dev , "Adding to IOMMU failed: %d\n" , err );
1631
- return err ;
1632
- }
1633
- if (!acpi_iommu_fwspec_ops (dev ))
1634
- return - ENODEV ;
1635
- return 0 ;
1615
+ return err ;
1636
1616
}
1637
1617
1638
1618
#else /* !CONFIG_IOMMU_API */
@@ -1672,6 +1652,8 @@ int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr,
1672
1652
ret = acpi_iommu_configure_id (dev , input_id );
1673
1653
if (ret == - EPROBE_DEFER )
1674
1654
return - EPROBE_DEFER ;
1655
+ if (ret )
1656
+ dev_dbg (dev , "Adding to IOMMU failed: %d\n" , ret );
1675
1657
1676
1658
arch_setup_dma_ops (dev , attr == DEV_DMA_COHERENT );
1677
1659
0 commit comments