Skip to contentSkip to conversation

pinctrl: tegra: Delete two error messages for a failed memory allocation in tegra_pinctrl_probe()

PATCH In review SF Markus Elfring 2 participants 2 messages Dec 28, 2017 – Jan 2, 2018

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

PATCH 1/1 pinctrl: tegra: Delete two error messages for a failed memory allocation in tegra_pinctrl_probe()

From: Markus Elfring <[email protected]>
Date: Thu, 28 Dec 2017 15:15:08 +0100

Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/pinctrl/tegra/pinctrl-tegra.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/pinctrl/tegra/pinctrl-tegra.c +3 -6
index 51716819129d..72c718e66ebb 100644
@@ -666,10 +666,9 @@ int tegra_pinctrl_probe(struct platform_device *pdev,
 	int fn, gn, gfn;
 
 	pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
-	if (!pmx) {
-		dev_err(&pdev->dev, "Can't alloc tegra_pmx\n");
+	if (!pmx)
 		return -ENOMEM;
-	}
+
 	pmx->dev = &pdev->dev;
 	pmx->soc = soc_data;
 
@@ -722,10 +721,8 @@ int tegra_pinctrl_probe(struct platform_device *pdev,
 
 	pmx->regs = devm_kzalloc(&pdev->dev, pmx->nbanks * sizeof(*pmx->regs),
 				 GFP_KERNEL);
-	if (!pmx->regs) {
-		dev_err(&pdev->dev, "Can't alloc regs pointer\n");
+	if (!pmx->regs)
 		return -ENOMEM;
-	}
 
 	for (i = 0; i < pmx->nbanks; i++) {
 		res = platform_get_resource(pdev, IORESOURCE_MEM, i);
Signature · 1 line
2.15.1