From f5202c54dd1f2f5431e2ca24a53e83cc4210d6c6 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 21 Mar 2016 12:00:23 +0100 Subject: [PATCH] UPSTREAM: iommu/rockchip: Don't feed NULL res pointers to devres If we do, devres prints a "invalid resource" string in the error loglevel. Signed-off-by: Tomeu Vizoso Reviewed-by: Javier Martinez Canillas Signed-off-by: Joerg Roedel (cherry picked from commit 8d7f2d84ed2d44b05e1ce88fa4b74886af46a139) Change-Id: I3849bcaa4ceaea3247a8169b2a123a834011fbc5 Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 650c7e42afe8..ce1ed0deb384 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -1141,6 +1141,8 @@ static int rk_iommu_probe(struct platform_device *pdev) 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); if (IS_ERR(iommu->bases[i])) continue; -- 2.34.1