Skip to contentSkip to conversation

Misc: sram: Remove unneeded check

PATCH In review Alexander Shiyan 2 participants 2 messages Jun 10, 2013 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Misc: sram: Remove unneeded check

Patch removes unneeded check for resource since
devm_ioremap_resource do all for us.

---
 drivers/misc/sram.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/misc/sram.c +1 -5
index 4a93886..d87cc91 100644
@@ -45,15 +45,11 @@ static int sram_probe(struct platform_device *pdev)
 	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -EINVAL;
-
-	size = resource_size(res);
-
 	virt_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(virt_base))
 		return PTR_ERR(virt_base);
 
+	size = resource_size(res);
 
 	sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL);
 	if (!sram)
Signature · 1 line
1.8.1.5