Skip to contentSkip to conversation

mfd/ti_am335x_tscadc: Delete an error message for a failed memory allocation in ti_tscadc_probe()

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

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

PATCH 1/1 mfd/ti_am335x_tscadc: Delete an error message for a failed memory allocation in ti_tscadc_probe()

From: Markus Elfring <[email protected]>
Date: Tue, 16 Jan 2018 10:07:43 +0100

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

This issue was detected by using the Coccinelle software.

---
 drivers/mfd/ti_am335x_tscadc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mfd/ti_am335x_tscadc.c +2 -3
index 3cd958a31f36..47012c0899cd 100644
@@ -169,10 +169,9 @@ static	int ti_tscadc_probe(struct platform_device *pdev)
 
 	/* Allocate memory for device */
 	tscadc = devm_kzalloc(&pdev->dev, sizeof(*tscadc), GFP_KERNEL);
-	if (!tscadc) {
-		dev_err(&pdev->dev, "failed to allocate memory.\n");
+	if (!tscadc)
 		return -ENOMEM;
-	}
+
 	tscadc->dev = &pdev->dev;
 
 	err = platform_get_irq(pdev, 0);
Signature · 1 line
2.15.1