diff mbox series

[4/6] iommu/exynos: Convert to devm_platform_ioremap_resource()

Message ID 20230705130416.46710-4-frank.li@vivo.com (mailing list archive)
State New
Headers show
Series None | expand

Commit Message

Yangtao Li July 5, 2023, 1:04 p.m. UTC
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/iommu/exynos-iommu.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Marek Szyprowski July 10, 2023, 2:41 p.m. UTC | #1
On 05.07.2023 15:04, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>


> ---
>   drivers/iommu/exynos-iommu.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
> index c275fe71c4db..ab6208015997 100644
> --- a/drivers/iommu/exynos-iommu.c
> +++ b/drivers/iommu/exynos-iommu.c
> @@ -725,19 +725,17 @@ 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);
>   
>   	irq = platform_get_irq(pdev, 0);
> -	if (irq <= 0)
> +	if (irq < 0)
>   		return irq;
>   
>   	ret = devm_request_irq(dev, irq, exynos_sysmmu_irq, 0,

Best regards
diff mbox series

Patch

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index c275fe71c4db..ab6208015997 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -725,19 +725,17 @@  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);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0)
+	if (irq < 0)
 		return irq;
 
 	ret = devm_request_irq(dev, irq, exynos_sysmmu_irq, 0,