iommu/omap: convert to devm_platform_ioremap_resource
Subsystems (8)
PATCH 1/6 iommu/omap: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code.
--- drivers/iommu/omap-iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iommu/omap-iommu.c +1 -3
@@ -1175,7 +1175,6 @@ static int omap_iommu_probe(struct platform_device *pdev)int err = -ENODEV ;int irq;struct omap_iommu *obj; -struct resource *res;struct device_node *of = pdev->dev.of_node;struct orphan_dev *orphan_dev, *tmp;
@@ -1218,8 +1217,7 @@ static int omap_iommu_probe(struct platform_device *pdev)spin_lock_init (&obj->iommu_lock);spin_lock_init (&obj->page_table_lock); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - obj->regbase =devm_ioremap_resource (obj->dev, res); + obj->regbase =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (obj->regbase))return PTR_ERR (obj->regbase);
Signature · 1 line
2.17.1
PATCH 1/1 virtio-mmio: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code, which contains platform_get_resource, devm_request_mem_region and devm_ioremap.
--- drivers/virtio/virtio_mmio.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/virtio/virtio_mmio.c +3 -12
@@ -531,18 +531,9 @@ static void virtio_mmio_release_dev(struct device *_d)static int virtio_mmio_probe (struct platform_device *pdev) {struct virtio_mmio_device *vm_dev; -struct resource *mem;unsigned long magic;int rc; - mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem) -return -EINVAL ; - -if (!devm_request_mem_region (&pdev->dev, mem->start, -resource_size (mem), pdev->name)) -return -EBUSY ; - vm_dev =devm_kzalloc (&pdev->dev,sizeof (*vm_dev),GFP_KERNEL );if (!vm_dev)return -ENOMEM ;
@@ -554,9 +545,9 @@ static int virtio_mmio_probe(struct platform_device *pdev)INIT_LIST_HEAD (&vm_dev->virtqueues);spin_lock_init (&vm_dev->lock); - vm_dev->base =devm_ioremap (&pdev->dev, mem->start,resource_size (mem)); -if (vm_dev->base ==NULL ) -return -EFAULT ; + vm_dev->base =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (vm_dev->base)) +return PTR_ERR (vm_dev->base);/* Check magic value */ magic =readl (vm_dev->base +VIRTIO_MMIO_MAGIC_VALUE );
Signature · 1 line
2.17.1
Re: [PATCH] virtio-mmio: convert to devm_platform_ioremap_resource
Please ignore this patch.
Thx!
Re: [PATCH] virtio-mmio: convert to devm_platform_ioremap_resource
In reply to Yangtao LiPlease ignore this patch.
Thx!
PATCH 1/1 virtio-mmio: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code, which contains platform_get_resource, devm_request_mem_region and devm_ioremap.
--- drivers/virtio/virtio_mmio.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/virtio/virtio_mmio.c +3 -12
@@ -531,18 +531,9 @@ static void virtio_mmio_release_dev(struct device *_d)static int virtio_mmio_probe (struct platform_device *pdev) {struct virtio_mmio_device *vm_dev; -struct resource *mem;unsigned long magic;int rc; - mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); -if (!mem) -return -EINVAL ; - -if (!devm_request_mem_region (&pdev->dev, mem->start, -resource_size (mem), pdev->name)) -return -EBUSY ; - vm_dev =devm_kzalloc (&pdev->dev,sizeof (*vm_dev),GFP_KERNEL );if (!vm_dev)return -ENOMEM ;
@@ -554,9 +545,9 @@ static int virtio_mmio_probe(struct platform_device *pdev)INIT_LIST_HEAD (&vm_dev->virtqueues);spin_lock_init (&vm_dev->lock); - vm_dev->base =devm_ioremap (&pdev->dev, mem->start,resource_size (mem)); -if (vm_dev->base ==NULL ) -return -EFAULT ; + vm_dev->base =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (vm_dev->base)) +return PTR_ERR (vm_dev->base);/* Check magic value */ magic =readl (vm_dev->base +VIRTIO_MMIO_MAGIC_VALUE );
Signature · 1 line
2.17.1
PATCH 2/6 iommu/exynos: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/iommu/exynos-iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iommu/exynos-iommu.c +1 -3
@@ -571,14 +571,12 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)int irq, ret;struct device *dev = &pdev->dev;struct sysmmu_drvdata *data; -struct resource *res; data =devm_kzalloc (dev,sizeof (*data),GFP_KERNEL );if (!data)return -ENOMEM ; - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - data->sfrbase =devm_ioremap_resource (dev, res); + data->sfrbase =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (data->sfrbase))return PTR_ERR (data->sfrbase);
Signature · 1 line
2.17.1
PATCH 3/6 iommu/qcom: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/iommu/qcom_iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iommu/qcom_iommu.c +1 -3
@@ -709,7 +709,6 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev)struct qcom_iommu_ctx *ctx;struct device *dev = &pdev->dev;struct qcom_iommu_dev *qcom_iommu =dev_get_drvdata (dev->parent); -struct resource *res;int ret, irq; ctx =devm_kzalloc (dev,sizeof (*ctx),GFP_KERNEL );
@@ -719,8 +718,7 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev) ctx->dev = dev;platform_set_drvdata (pdev, ctx); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - ctx->base =devm_ioremap_resource (dev, res); + ctx->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (ctx->base))return PTR_ERR (ctx->base);
Signature · 1 line
2.17.1
PATCH 4/6 iommu/ipmmu-vmsa: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/iommu/ipmmu-vmsa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iommu/ipmmu-vmsa.c +1 -3
@@ -1015,7 +1015,6 @@ static const struct of_device_id ipmmu_of_ids[] = {static int ipmmu_probe (struct platform_device *pdev) {struct ipmmu_vmsa_device *mmu; -struct resource *res;int irq;int ret;
@@ -1033,8 +1032,7 @@ static int ipmmu_probe(struct platform_device *pdev)dma_set_mask_and_coherent (&pdev->dev,DMA_BIT_MASK (40 ));/* Map I/O memory and request IRQ. */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - mmu->base =devm_ioremap_resource (&pdev->dev, res); + mmu->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (mmu->base))return PTR_ERR (mmu->base);
Signature · 1 line
2.17.1
PATCH 5/6 iommu/mediatek: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/iommu/mtk_iommu_v1.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iommu/mtk_iommu_v1.c +1 -3
@@ -553,7 +553,6 @@ static int mtk_iommu_probe(struct platform_device *pdev) {struct mtk_iommu_data *data;struct device *dev = &pdev->dev; -struct resource *res;struct component_match *match =NULL ;struct of_phandle_args larb_spec;struct of_phandle_iterator it;
@@ -573,8 +572,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)return -ENOMEM ; data->protect_base =ALIGN (virt_to_phys (protect),MTK_PROTECT_PA_ALIGN ); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - data->base =devm_ioremap_resource (dev, res); + data->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (data->base))return PTR_ERR (data->base);
Signature · 1 line
2.17.1
PATCH 5/6 iommu/mediatek: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/iommu/mtk_iommu_v1.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iommu/mtk_iommu_v1.c +1 -3
@@ -553,7 +553,6 @@ static int mtk_iommu_probe(struct platform_device *pdev) {struct mtk_iommu_data *data;struct device *dev = &pdev->dev; -struct resource *res;struct component_match *match =NULL ;struct of_phandle_args larb_spec;struct of_phandle_iterator it;
@@ -573,8 +572,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)return -ENOMEM ; data->protect_base =ALIGN (virt_to_phys (protect),MTK_PROTECT_PA_ALIGN ); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - data->base =devm_ioremap_resource (dev, res); + data->base =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (data->base))return PTR_ERR (data->base);
Signature · 1 line
2.17.1
PATCH 6/6 iommu/rockchip: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/iommu/rockchip-iommu.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/iommu/rockchip-iommu.c +1 -5
@@ -1138,7 +1138,6 @@ static int rk_iommu_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct rk_iommu *iommu; -struct resource *res;int num_res = pdev->num_resources;int err, i;
@@ -1156,10 +1155,7 @@ static int rk_iommu_probe(struct platform_device *pdev)return -ENOMEM ;for (i =0 ; i < num_res; i++) { - res =platform_get_resource (pdev,IORESOURCE_MEM , i); -if (!res) -continue ; - iommu->bases[i] =devm_ioremap_resource (&pdev->dev, res); + iommu->bases[i] =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (iommu->bases[i]))continue ; iommu->num_mmu++;
Signature · 1 line
2.17.1
PATCH 6/6 iommu/rockchip: convert to devm_platform_ioremap_resource
In reply to Yangtao LiUse devm_platform_ioremap_resource() to simplify code.
--- drivers/iommu/rockchip-iommu.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/iommu/rockchip-iommu.c +1 -5
@@ -1138,7 +1138,6 @@ static int rk_iommu_probe(struct platform_device *pdev) {struct device *dev = &pdev->dev;struct rk_iommu *iommu; -struct resource *res;int num_res = pdev->num_resources;int err, i;
@@ -1156,10 +1155,7 @@ static int rk_iommu_probe(struct platform_device *pdev)return -ENOMEM ;for (i =0 ; i < num_res; i++) { - res =platform_get_resource (pdev,IORESOURCE_MEM , i); -if (!res) -continue ; - iommu->bases[i] =devm_ioremap_resource (&pdev->dev, res); + iommu->bases[i] =devm_platform_ioremap_resource (pdev,0 );if (IS_ERR (iommu->bases[i]))continue ; iommu->num_mmu++;
Signature · 1 line
2.17.1