35
35
36
36
static const struct iommu_ops omap_iommu_ops ;
37
37
38
- struct orphan_dev {
39
- struct device * dev ;
40
- struct list_head node ;
41
- };
42
-
43
- static LIST_HEAD (orphan_dev_list );
44
-
45
- static DEFINE_SPINLOCK (orphan_lock );
46
-
47
38
#define to_iommu (dev ) ((struct omap_iommu *)dev_get_drvdata(dev))
48
39
49
40
/* bitmap of the page sizes currently supported */
@@ -62,8 +53,6 @@ static DEFINE_SPINLOCK(orphan_lock);
62
53
static struct platform_driver omap_iommu_driver ;
63
54
static struct kmem_cache * iopte_cachep ;
64
55
65
- static int _omap_iommu_add_device (struct device * dev );
66
-
67
56
/**
68
57
* to_omap_domain - Get struct omap_iommu_domain from generic iommu_domain
69
58
* @dom: generic iommu domain handle
@@ -1177,7 +1166,6 @@ static int omap_iommu_probe(struct platform_device *pdev)
1177
1166
struct omap_iommu * obj ;
1178
1167
struct resource * res ;
1179
1168
struct device_node * of = pdev -> dev .of_node ;
1180
- struct orphan_dev * orphan_dev , * tmp ;
1181
1169
1182
1170
if (!of ) {
1183
1171
pr_err ("%s: only DT-based devices are supported\n" , __func__ );
@@ -1260,13 +1248,8 @@ static int omap_iommu_probe(struct platform_device *pdev)
1260
1248
1261
1249
dev_info (& pdev -> dev , "%s registered\n" , obj -> name );
1262
1250
1263
- list_for_each_entry_safe (orphan_dev , tmp , & orphan_dev_list , node ) {
1264
- err = _omap_iommu_add_device (orphan_dev -> dev );
1265
- if (!err ) {
1266
- list_del (& orphan_dev -> node );
1267
- kfree (orphan_dev );
1268
- }
1269
- }
1251
+ /* Re-probe bus to probe device attached to this IOMMU */
1252
+ bus_iommu_probe (& platform_bus_type );
1270
1253
1271
1254
return 0 ;
1272
1255
@@ -1657,7 +1640,7 @@ static phys_addr_t omap_iommu_iova_to_phys(struct iommu_domain *domain,
1657
1640
return ret ;
1658
1641
}
1659
1642
1660
- static int _omap_iommu_add_device (struct device * dev )
1643
+ static int omap_iommu_add_device (struct device * dev )
1661
1644
{
1662
1645
struct omap_iommu_arch_data * arch_data , * tmp ;
1663
1646
struct omap_iommu * oiommu ;
@@ -1666,8 +1649,6 @@ static int _omap_iommu_add_device(struct device *dev)
1666
1649
struct platform_device * pdev ;
1667
1650
int num_iommus , i ;
1668
1651
int ret ;
1669
- struct orphan_dev * orphan_dev ;
1670
- unsigned long flags ;
1671
1652
1672
1653
/*
1673
1654
* Allocate the archdata iommu structure for DT-based devices.
@@ -1702,23 +1683,7 @@ static int _omap_iommu_add_device(struct device *dev)
1702
1683
if (!pdev ) {
1703
1684
of_node_put (np );
1704
1685
kfree (arch_data );
1705
- spin_lock_irqsave (& orphan_lock , flags );
1706
- list_for_each_entry (orphan_dev , & orphan_dev_list ,
1707
- node ) {
1708
- if (orphan_dev -> dev == dev )
1709
- break ;
1710
- }
1711
- spin_unlock_irqrestore (& orphan_lock , flags );
1712
-
1713
- if (orphan_dev && orphan_dev -> dev == dev )
1714
- return - EPROBE_DEFER ;
1715
-
1716
- orphan_dev = kzalloc (sizeof (* orphan_dev ), GFP_KERNEL );
1717
- orphan_dev -> dev = dev ;
1718
- spin_lock_irqsave (& orphan_lock , flags );
1719
- list_add (& orphan_dev -> node , & orphan_dev_list );
1720
- spin_unlock_irqrestore (& orphan_lock , flags );
1721
- return - EPROBE_DEFER ;
1686
+ return - ENODEV ;
1722
1687
}
1723
1688
1724
1689
oiommu = platform_get_drvdata (pdev );
@@ -1764,17 +1729,6 @@ static int _omap_iommu_add_device(struct device *dev)
1764
1729
return 0 ;
1765
1730
}
1766
1731
1767
- static int omap_iommu_add_device (struct device * dev )
1768
- {
1769
- int ret ;
1770
-
1771
- ret = _omap_iommu_add_device (dev );
1772
- if (ret == - EPROBE_DEFER )
1773
- return 0 ;
1774
-
1775
- return ret ;
1776
- }
1777
-
1778
1732
static void omap_iommu_remove_device (struct device * dev )
1779
1733
{
1780
1734
struct omap_iommu_arch_data * arch_data = dev -> archdata .iommu ;
0 commit comments