Commit bcb5fe44875b09756c5e81925de19f9ca5bb9117

Authored by Axel Lin
Committed by Mark Brown
1 parent 9e2bfbbdf2

regulator: 88pm8607: Convert to devm_regulator_register

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

Showing 1 changed file with 2 additions and 10 deletions Side-by-side Diff

drivers/regulator/88pm8607.c
... ... @@ -391,7 +391,8 @@
391 391 else
392 392 config.regmap = chip->regmap_companion;
393 393  
394   - info->regulator = regulator_register(&info->desc, &config);
  394 + info->regulator = devm_regulator_register(&pdev->dev, &info->desc,
  395 + &config);
395 396 if (IS_ERR(info->regulator)) {
396 397 dev_err(&pdev->dev, "failed to register regulator %s\n",
397 398 info->desc.name);
... ... @@ -402,14 +403,6 @@
402 403 return 0;
403 404 }
404 405  
405   -static int pm8607_regulator_remove(struct platform_device *pdev)
406   -{
407   - struct pm8607_regulator_info *info = platform_get_drvdata(pdev);
408   -
409   - regulator_unregister(info->regulator);
410   - return 0;
411   -}
412   -
413 406 static struct platform_device_id pm8607_regulator_driver_ids[] = {
414 407 {
415 408 .name = "88pm860x-regulator",
... ... @@ -428,7 +421,6 @@
428 421 .owner = THIS_MODULE,
429 422 },
430 423 .probe = pm8607_regulator_probe,
431   - .remove = pm8607_regulator_remove,
432 424 .id_table = pm8607_regulator_driver_ids,
433 425 };
434 426