Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165383
b: refs/heads/master
c: 72b8687
h: refs/heads/master
i:
  165381: 2cda0b6
  165379: 906e6a7
  165375: f5d0b40
v: v3
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Sep 22, 2009
1 parent add304a commit d511761
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ed2099edca26d07947beb42c12bd1d6669e82bc
refs/heads/master: 72b86876d437a33253a47373579787b6dcc3bd36
12 changes: 8 additions & 4 deletions trunk/drivers/regulator/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ static int regulator_virtual_consumer_probe(struct platform_device *pdev)

drvdata = kzalloc(sizeof(struct virtual_consumer_data), GFP_KERNEL);
if (drvdata == NULL) {
ret = -ENOMEM;
goto err;
return -ENOMEM;
}

mutex_init(&drvdata->lock);
Expand All @@ -302,8 +301,11 @@ static int regulator_virtual_consumer_probe(struct platform_device *pdev)

for (i = 0; i < ARRAY_SIZE(attributes); i++) {
ret = device_create_file(&pdev->dev, attributes[i]);
if (ret != 0)
goto err;
if (ret != 0) {
dev_err(&pdev->dev, "Failed to create attr %d: %d\n",
i, ret);
goto err_regulator;
}
}

drvdata->mode = regulator_get_mode(drvdata->regulator);
Expand All @@ -312,6 +314,8 @@ static int regulator_virtual_consumer_probe(struct platform_device *pdev)

return 0;

err_regulator:
regulator_put(drvdata->regulator);
err:
for (i = 0; i < ARRAY_SIZE(attributes); i++)
device_remove_file(&pdev->dev, attributes[i]);
Expand Down

0 comments on commit d511761

Please sign in to comment.