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

Commit af54decd authored by Dan Carpenter's avatar Dan Carpenter Committed by Liam Girdwood
Browse files

regulator/ab8500: move dereference below the check for NULL



I moved the dereference of "ab8500" below the check for NULL.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 2bfc96a1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -344,13 +344,14 @@ static inline struct ab8500_regulator_info *find_regulator_info(int id)
static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
{
	struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
	struct ab8500_platform_data *pdata = dev_get_platdata(ab8500->dev);
	struct ab8500_platform_data *pdata;
	int i, err;

	if (!ab8500) {
		dev_err(&pdev->dev, "null mfd parent\n");
		return -EINVAL;
	}
	pdata = dev_get_platdata(ab8500->dev);

	/* register all regulators */
	for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) {