Skip to contentSkip to conversation

mtd/nand/omap2: Delete an error message for a failed memory allocation in omap_nand_probe()

PATCH New SF Markus Elfring 1 participant 1 message Jan 5, 2018

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

PATCH 1/1 mtd/nand/omap2: Delete an error message for a failed memory allocation in omap_nand_probe()

From: Markus Elfring <[email protected]>
Date: Fri, 5 Jan 2018 22:10:39 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/mtd/nand/omap2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/nand/omap2.c +1 -3
index dad438c4906a..5c96c291426b 100644
@@ -1947,10 +1947,8 @@ static int omap_nand_probe(struct platform_device *pdev)
 	if (!mtd->name) {
 		mtd->name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
 					   "omap2-nand.%d", info->gpmc_cs);
-		if (!mtd->name) {
-			dev_err(&pdev->dev, "Failed to set MTD name\n");
+		if (!mtd->name)
 			return -ENOMEM;
-		}
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Signature · 1 line
2.15.1