regulator/ab8500: move dereference below the check for NULL
Subsystems (2)
PATCH 1/1 regulator/ab8500: move dereference below the check for NULL
I moved the dereference of "ab8500" below the check for NULL.
Signed-off-by Dan Carpenter <[email protected]>
drivers/regulator/ab8500.c +2 -1
@@ -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++) {
Quoted 3 lines · Dan Carpenter
I moved the dereference of "ab8500" below the check for NULL.
Signed-off-by Dan Carpenter <[email protected]>
Acked-by Mark Brown <[email protected]>
Quoted 7 lines · Mark Brown
Quoted 3 lines · Dan Carpenter
I moved the dereference of "ab8500" below the check for NULL.
Signed-off-by Dan Carpenter <[email protected]>Acked-by Mark Brown <[email protected]>
Thanx!
Regards,
Sundar
Liam Girdwood
AppliedQuoted 7 lines · Mark Brown
Quoted 3 lines · Dan Carpenter
I moved the dereference of "ab8500" below the check for NULL.
Signed-off-by Dan Carpenter <[email protected]>Acked-by Mark Brown <[email protected]>
Applied.
Thanks
Liam
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk