[PATCH arm-soc 1/2] mach-omap2: gpmc: remove duplicate check on resource
Varka Bhadram
varkabhadram at gmail.com
Tue Oct 21 03:33:31 PDT 2014
Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: Varka Bhadram <varkab at cdac.in>
---
arch/arm/mach-omap2/gpmc.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 9f42d54..ff5c4d6 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1653,16 +1653,13 @@ static int gpmc_probe(struct platform_device *pdev)
struct resource *res;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (res == NULL)
- return -ENOENT;
-
- phys_base = res->start;
- mem_size = resource_size(res);
-
gpmc_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(gpmc_base))
return PTR_ERR(gpmc_base);
+ phys_base = res->start;
+ mem_size = resource_size(res);
+
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL)
dev_warn(&pdev->dev, "Failed to get resource: irq\n");
--
1.7.9.5
More information about the linux-arm-kernel
mailing list