iommu/renesas: Use accessor functions for iommu private data
Make use of dev_iommu_priv_set/get() functions. Signed-off-by: Joerg Roedel <jroedel@suse.de> Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Link: https://lore.kernel.org/r/20200326150841.10083-13-joro@8bytes.org
This commit is contained in:
parent
c84500a365
commit
be568d6d5a
|
@ -89,9 +89,7 @@ static struct ipmmu_vmsa_domain *to_vmsa_domain(struct iommu_domain *dom)
|
||||||
|
|
||||||
static struct ipmmu_vmsa_device *to_ipmmu(struct device *dev)
|
static struct ipmmu_vmsa_device *to_ipmmu(struct device *dev)
|
||||||
{
|
{
|
||||||
struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
|
return dev_iommu_priv_get(dev);
|
||||||
|
|
||||||
return fwspec ? fwspec->iommu_priv : NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TLB_LOOP_TIMEOUT 100 /* 100us */
|
#define TLB_LOOP_TIMEOUT 100 /* 100us */
|
||||||
|
@ -727,14 +725,13 @@ static phys_addr_t ipmmu_iova_to_phys(struct iommu_domain *io_domain,
|
||||||
static int ipmmu_init_platform_device(struct device *dev,
|
static int ipmmu_init_platform_device(struct device *dev,
|
||||||
struct of_phandle_args *args)
|
struct of_phandle_args *args)
|
||||||
{
|
{
|
||||||
struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
|
|
||||||
struct platform_device *ipmmu_pdev;
|
struct platform_device *ipmmu_pdev;
|
||||||
|
|
||||||
ipmmu_pdev = of_find_device_by_node(args->np);
|
ipmmu_pdev = of_find_device_by_node(args->np);
|
||||||
if (!ipmmu_pdev)
|
if (!ipmmu_pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
fwspec->iommu_priv = platform_get_drvdata(ipmmu_pdev);
|
dev_iommu_priv_set(dev, platform_get_drvdata(ipmmu_pdev));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue