@@ -71,7 +71,7 @@ static struct omap_iommu_domain *to_omap_domain(struct iommu_domain *dom)
71
71
**/
72
72
void omap_iommu_save_ctx (struct device * dev )
73
73
{
74
- struct omap_iommu_arch_data * arch_data = dev -> archdata . iommu ;
74
+ struct omap_iommu_arch_data * arch_data = dev_iommu_priv_get ( dev ) ;
75
75
struct omap_iommu * obj ;
76
76
u32 * p ;
77
77
int i ;
@@ -101,7 +101,7 @@ EXPORT_SYMBOL_GPL(omap_iommu_save_ctx);
101
101
**/
102
102
void omap_iommu_restore_ctx (struct device * dev )
103
103
{
104
- struct omap_iommu_arch_data * arch_data = dev -> archdata . iommu ;
104
+ struct omap_iommu_arch_data * arch_data = dev_iommu_priv_get ( dev ) ;
105
105
struct omap_iommu * obj ;
106
106
u32 * p ;
107
107
int i ;
@@ -1398,7 +1398,7 @@ static size_t omap_iommu_unmap(struct iommu_domain *domain, unsigned long da,
1398
1398
1399
1399
static int omap_iommu_count (struct device * dev )
1400
1400
{
1401
- struct omap_iommu_arch_data * arch_data = dev -> archdata . iommu ;
1401
+ struct omap_iommu_arch_data * arch_data = dev_iommu_priv_get ( dev ) ;
1402
1402
int count = 0 ;
1403
1403
1404
1404
while (arch_data -> iommu_dev ) {
@@ -1459,8 +1459,8 @@ static void omap_iommu_detach_fini(struct omap_iommu_domain *odomain)
1459
1459
static int
1460
1460
omap_iommu_attach_dev (struct iommu_domain * domain , struct device * dev )
1461
1461
{
1462
+ struct omap_iommu_arch_data * arch_data = dev_iommu_priv_get (dev );
1462
1463
struct omap_iommu_domain * omap_domain = to_omap_domain (domain );
1463
- struct omap_iommu_arch_data * arch_data = dev -> archdata .iommu ;
1464
1464
struct omap_iommu_device * iommu ;
1465
1465
struct omap_iommu * oiommu ;
1466
1466
int ret = 0 ;
@@ -1524,7 +1524,7 @@ omap_iommu_attach_dev(struct iommu_domain *domain, struct device *dev)
1524
1524
static void _omap_iommu_detach_dev (struct omap_iommu_domain * omap_domain ,
1525
1525
struct device * dev )
1526
1526
{
1527
- struct omap_iommu_arch_data * arch_data = dev -> archdata . iommu ;
1527
+ struct omap_iommu_arch_data * arch_data = dev_iommu_priv_get ( dev ) ;
1528
1528
struct omap_iommu_device * iommu = omap_domain -> iommus ;
1529
1529
struct omap_iommu * oiommu ;
1530
1530
int i ;
@@ -1650,7 +1650,7 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
1650
1650
int num_iommus , i ;
1651
1651
1652
1652
/*
1653
- * Allocate the archdata iommu structure for DT-based devices.
1653
+ * Allocate the per-device iommu structure for DT-based devices.
1654
1654
*
1655
1655
* TODO: Simplify this when removing non-DT support completely from the
1656
1656
* IOMMU users.
@@ -1698,7 +1698,7 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
1698
1698
of_node_put (np );
1699
1699
}
1700
1700
1701
- dev -> archdata . iommu = arch_data ;
1701
+ dev_iommu_priv_set ( dev , arch_data ) ;
1702
1702
1703
1703
/*
1704
1704
* use the first IOMMU alone for the sysfs device linking.
@@ -1712,19 +1712,19 @@ static struct iommu_device *omap_iommu_probe_device(struct device *dev)
1712
1712
1713
1713
static void omap_iommu_release_device (struct device * dev )
1714
1714
{
1715
- struct omap_iommu_arch_data * arch_data = dev -> archdata . iommu ;
1715
+ struct omap_iommu_arch_data * arch_data = dev_iommu_priv_get ( dev ) ;
1716
1716
1717
1717
if (!dev -> of_node || !arch_data )
1718
1718
return ;
1719
1719
1720
- dev -> archdata . iommu = NULL ;
1720
+ dev_iommu_priv_set ( dev , NULL ) ;
1721
1721
kfree (arch_data );
1722
1722
1723
1723
}
1724
1724
1725
1725
static struct iommu_group * omap_iommu_device_group (struct device * dev )
1726
1726
{
1727
- struct omap_iommu_arch_data * arch_data = dev -> archdata . iommu ;
1727
+ struct omap_iommu_arch_data * arch_data = dev_iommu_priv_get ( dev ) ;
1728
1728
struct iommu_group * group = ERR_PTR (- EINVAL );
1729
1729
1730
1730
if (!arch_data )
0 commit comments