mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-22 20:43:56 +08:00
iommu/rockchip: Use dev_iommu_priv_get/set()
Remove the use of dev->archdata.iommu and use the private per-device pointer provided by IOMMU core code instead. Signed-off-by: Joerg Roedel <jroedel@suse.de> Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Link: https://lore.kernel.org/r/20200625130836.1916-6-joro@8bytes.org
This commit is contained in:
parent
97ea120260
commit
8b9cc3b71b
@ -836,7 +836,7 @@ static size_t rk_iommu_unmap(struct iommu_domain *domain, unsigned long _iova,
|
|||||||
|
|
||||||
static struct rk_iommu *rk_iommu_from_dev(struct device *dev)
|
static struct rk_iommu *rk_iommu_from_dev(struct device *dev)
|
||||||
{
|
{
|
||||||
struct rk_iommudata *data = dev->archdata.iommu;
|
struct rk_iommudata *data = dev_iommu_priv_get(dev);
|
||||||
|
|
||||||
return data ? data->iommu : NULL;
|
return data ? data->iommu : NULL;
|
||||||
}
|
}
|
||||||
@ -1059,7 +1059,7 @@ static struct iommu_device *rk_iommu_probe_device(struct device *dev)
|
|||||||
struct rk_iommudata *data;
|
struct rk_iommudata *data;
|
||||||
struct rk_iommu *iommu;
|
struct rk_iommu *iommu;
|
||||||
|
|
||||||
data = dev->archdata.iommu;
|
data = dev_iommu_priv_get(dev);
|
||||||
if (!data)
|
if (!data)
|
||||||
return ERR_PTR(-ENODEV);
|
return ERR_PTR(-ENODEV);
|
||||||
|
|
||||||
@ -1073,7 +1073,7 @@ static struct iommu_device *rk_iommu_probe_device(struct device *dev)
|
|||||||
|
|
||||||
static void rk_iommu_release_device(struct device *dev)
|
static void rk_iommu_release_device(struct device *dev)
|
||||||
{
|
{
|
||||||
struct rk_iommudata *data = dev->archdata.iommu;
|
struct rk_iommudata *data = dev_iommu_priv_get(dev);
|
||||||
|
|
||||||
device_link_del(data->link);
|
device_link_del(data->link);
|
||||||
}
|
}
|
||||||
@ -1100,7 +1100,7 @@ static int rk_iommu_of_xlate(struct device *dev,
|
|||||||
iommu_dev = of_find_device_by_node(args->np);
|
iommu_dev = of_find_device_by_node(args->np);
|
||||||
|
|
||||||
data->iommu = platform_get_drvdata(iommu_dev);
|
data->iommu = platform_get_drvdata(iommu_dev);
|
||||||
dev->archdata.iommu = data;
|
dev_iommu_priv_set(dev, data);
|
||||||
|
|
||||||
platform_device_put(iommu_dev);
|
platform_device_put(iommu_dev);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user