Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f8eaff2 authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by David Woodhouse
Browse files

mtd: nand: pxa3xx: Check for clk_prepare_enable() return value



clk_prepare_enable() can fail due to unknown reason.
Add a check for this and return the error code if it fails.

Signed-off-by: default avatarEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent fb32061f
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1072,7 +1072,9 @@ static int alloc_nand_resource(struct platform_device *pdev)
		dev_err(&pdev->dev, "failed to get nand clock\n");
		dev_err(&pdev->dev, "failed to get nand clock\n");
		return PTR_ERR(info->clk);
		return PTR_ERR(info->clk);
	}
	}
	clk_prepare_enable(info->clk);
	ret = clk_prepare_enable(info->clk);
	if (ret < 0)
		return ret;


	/*
	/*
	 * This is a dirty hack to make this driver work from devicetree
	 * This is a dirty hack to make this driver work from devicetree