Skip to content

Commit

Permalink
regulator/ab8500: move dereference below the check for NULL
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Liam Girdwood committed Sep 1, 2010
1 parent 2bfc96a commit af54dec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/regulator/ab8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit af54dec

Please sign in to comment.