Skip to content

Commit af54dec

Browse files
error27Liam Girdwood
authored andcommitted
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 <error27@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
1 parent 2bfc96a commit af54dec

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/regulator/ab8500.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,14 @@ static inline struct ab8500_regulator_info *find_regulator_info(int id)
344344
static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
345345
{
346346
struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
347-
struct ab8500_platform_data *pdata = dev_get_platdata(ab8500->dev);
347+
struct ab8500_platform_data *pdata;
348348
int i, err;
349349

350350
if (!ab8500) {
351351
dev_err(&pdev->dev, "null mfd parent\n");
352352
return -EINVAL;
353353
}
354+
pdata = dev_get_platdata(ab8500->dev);
354355

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

0 commit comments

Comments
 (0)