Skip to contentSkip to conversation

iommu/exynos: checking for IS_ERR() instead of NULL

PATCH Applied Dan Carpenter 3 participants 3 messages Mar 2, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu/exynos: checking for IS_ERR() instead of NULL

of_platform_device_create() returns NULL on error, it never returns error pointers.

Fixes 8ed55c812fa8 ('iommu/exynos: Init from dt-specific callback instead of initcall')
drivers/iommu/exynos-iommu.c +2 -2
index b066504..cb57bda 100644
@@ -1347,8 +1347,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
 		exynos_iommu_init();
 
 	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	if (!pdev)
+		return -ENOMEM;
 
 	/*
 	 * use the first registered sysmmu device for performing
maintainer Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 5 lines · Dan Carpenter

of_platform_device_create() returns NULL on error, it never returns error pointers.

Fixes 8ed55c812fa8 ('iommu/exynos: Init from dt-specific callback instead of initcall')
Quoted 7 lines
drivers/iommu/exynos-iommu.c +0 -0
index b066504..cb57bda 100644

drivers/iommu/exynos-iommu.c static int __init exynos_iommu_of_setup(struct device_node *np) · line 1354

Quoted 10 lines
drivers/iommu/exynos-iommu.c +2 -2
@@ -1347,8 +1347,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
  		exynos_iommu_init();
 
  	pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
-	if (IS_ERR(pdev))
-		return PTR_ERR(pdev);
+	if (!pdev)
+		return -ENOMEM;
 
  	/*
  	 * use the first registered sysmmu device for performing

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland