Skip to content

Commit b18b2e7

Browse files
elfringLinus Walleij
authored andcommitted
pinctrl: tegra: Delete two error messages for a failed memory allocation in tegra_pinctrl_probe()
Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 51d7a03 commit b18b2e7

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎drivers/pinctrl/tegra/pinctrl-tegra.c‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,9 @@ int tegra_pinctrl_probe(struct platform_device *pdev,
666666
int fn, gn, gfn;
667667

668668
pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
669-
if (!pmx) {
670-
dev_err(&pdev->dev, "Can't alloc tegra_pmx\n");
669+
if (!pmx)
671670
return -ENOMEM;
672-
}
671+
673672
pmx->dev = &pdev->dev;
674673
pmx->soc = soc_data;
675674

@@ -722,10 +721,8 @@ int tegra_pinctrl_probe(struct platform_device *pdev,
722721

723722
pmx->regs = devm_kzalloc(&pdev->dev, pmx->nbanks * sizeof(*pmx->regs),
724723
GFP_KERNEL);
725-
if (!pmx->regs) {
726-
dev_err(&pdev->dev, "Can't alloc regs pointer\n");
724+
if (!pmx->regs)
727725
return -ENOMEM;
728-
}
729726

730727
for (i = 0; i < pmx->nbanks; i++) {
731728
res = platform_get_resource(pdev, IORESOURCE_MEM, i);

0 commit comments

Comments
 (0)