iommu/rockchip: Don't feed NULL res pointers to devres
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Mon, 21 Mar 2016 11:00:23 +0000 (12:00 +0100)
committerJoerg Roedel <jroedel@suse.de>
Tue, 5 Apr 2016 14:27:07 +0000 (16:27 +0200)
If we do, devres prints a "invalid resource" string in the error
loglevel.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/rockchip-iommu.c

index a6f593a0a29eda65c1f383dbe1700c13a8e9be27..0253ab35c33b60b48cb2aeac5f1748e045014abf 100644 (file)
@@ -1049,6 +1049,8 @@ static int rk_iommu_probe(struct platform_device *pdev)
 
        for (i = 0; i < pdev->num_resources; 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;