Commit b18b2e77 authored by Markus Elfring's avatar Markus Elfring Committed by Linus Walleij
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 51d7a036
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -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);