Loading Documentation/driver-model/devres.txt +1 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,7 @@ REGULATOR devm_regulator_get() devm_regulator_put() devm_regulator_bulk_get() devm_regulator_register() CLOCK devm_clk_get() Loading drivers/regulator/88pm8607.c +2 −10 Original line number Diff line number Diff line Loading @@ -391,7 +391,8 @@ static int pm8607_regulator_probe(struct platform_device *pdev) else config.regmap = chip->regmap_companion; info->regulator = regulator_register(&info->desc, &config); info->regulator = devm_regulator_register(&pdev->dev, &info->desc, &config); if (IS_ERR(info->regulator)) { dev_err(&pdev->dev, "failed to register regulator %s\n", info->desc.name); Loading @@ -402,14 +403,6 @@ static int pm8607_regulator_probe(struct platform_device *pdev) return 0; } static int pm8607_regulator_remove(struct platform_device *pdev) { struct pm8607_regulator_info *info = platform_get_drvdata(pdev); regulator_unregister(info->regulator); return 0; } static struct platform_device_id pm8607_regulator_driver_ids[] = { { .name = "88pm860x-regulator", Loading @@ -428,7 +421,6 @@ static struct platform_driver pm8607_regulator_driver = { .owner = THIS_MODULE, }, .probe = pm8607_regulator_probe, .remove = pm8607_regulator_remove, .id_table = pm8607_regulator_driver_ids, }; Loading drivers/regulator/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ # obj-$(CONFIG_REGULATOR) += core.o dummy.o fixed-helper.o helpers.o obj-$(CONFIG_REGULATOR) += core.o dummy.o fixed-helper.o helpers.o devres.o obj-$(CONFIG_OF) += of_regulator.o obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o Loading drivers/regulator/aat2870-regulator.c +1 −10 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev) config.driver_data = ri; config.init_data = dev_get_platdata(&pdev->dev); rdev = regulator_register(&ri->desc, &config); rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config); if (IS_ERR(rdev)) { dev_err(&pdev->dev, "Failed to register regulator %s\n", ri->desc.name); Loading @@ -187,21 +187,12 @@ static int aat2870_regulator_probe(struct platform_device *pdev) return 0; } static int aat2870_regulator_remove(struct platform_device *pdev) { struct regulator_dev *rdev = platform_get_drvdata(pdev); regulator_unregister(rdev); return 0; } static struct platform_driver aat2870_regulator_driver = { .driver = { .name = "aat2870-regulator", .owner = THIS_MODULE, }, .probe = aat2870_regulator_probe, .remove = aat2870_regulator_remove, }; static int __init aat2870_regulator_init(void) Loading drivers/regulator/ad5398.c +3 −16 Original line number Diff line number Diff line Loading @@ -219,7 +219,6 @@ static int ad5398_probe(struct i2c_client *client, struct ad5398_chip_info *chip; const struct ad5398_current_data_format *df = (struct ad5398_current_data_format *)id->driver_data; int ret; if (!init_data) return -EINVAL; Loading @@ -240,33 +239,21 @@ static int ad5398_probe(struct i2c_client *client, chip->current_offset = df->current_offset; chip->current_mask = (chip->current_level - 1) << chip->current_offset; chip->rdev = regulator_register(&ad5398_reg, &config); chip->rdev = devm_regulator_register(&client->dev, &ad5398_reg, &config); if (IS_ERR(chip->rdev)) { ret = PTR_ERR(chip->rdev); dev_err(&client->dev, "failed to register %s %s\n", id->name, ad5398_reg.name); goto err; return PTR_ERR(chip->rdev); } i2c_set_clientdata(client, chip); dev_dbg(&client->dev, "%s regulator driver is registered.\n", id->name); return 0; err: return ret; } static int ad5398_remove(struct i2c_client *client) { struct ad5398_chip_info *chip = i2c_get_clientdata(client); regulator_unregister(chip->rdev); return 0; } static struct i2c_driver ad5398_driver = { .probe = ad5398_probe, .remove = ad5398_remove, .driver = { .name = "ad5398", }, Loading Loading
Documentation/driver-model/devres.txt +1 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,7 @@ REGULATOR devm_regulator_get() devm_regulator_put() devm_regulator_bulk_get() devm_regulator_register() CLOCK devm_clk_get() Loading
drivers/regulator/88pm8607.c +2 −10 Original line number Diff line number Diff line Loading @@ -391,7 +391,8 @@ static int pm8607_regulator_probe(struct platform_device *pdev) else config.regmap = chip->regmap_companion; info->regulator = regulator_register(&info->desc, &config); info->regulator = devm_regulator_register(&pdev->dev, &info->desc, &config); if (IS_ERR(info->regulator)) { dev_err(&pdev->dev, "failed to register regulator %s\n", info->desc.name); Loading @@ -402,14 +403,6 @@ static int pm8607_regulator_probe(struct platform_device *pdev) return 0; } static int pm8607_regulator_remove(struct platform_device *pdev) { struct pm8607_regulator_info *info = platform_get_drvdata(pdev); regulator_unregister(info->regulator); return 0; } static struct platform_device_id pm8607_regulator_driver_ids[] = { { .name = "88pm860x-regulator", Loading @@ -428,7 +421,6 @@ static struct platform_driver pm8607_regulator_driver = { .owner = THIS_MODULE, }, .probe = pm8607_regulator_probe, .remove = pm8607_regulator_remove, .id_table = pm8607_regulator_driver_ids, }; Loading
drivers/regulator/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ # obj-$(CONFIG_REGULATOR) += core.o dummy.o fixed-helper.o helpers.o obj-$(CONFIG_REGULATOR) += core.o dummy.o fixed-helper.o helpers.o devres.o obj-$(CONFIG_OF) += of_regulator.o obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o Loading
drivers/regulator/aat2870-regulator.c +1 −10 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev) config.driver_data = ri; config.init_data = dev_get_platdata(&pdev->dev); rdev = regulator_register(&ri->desc, &config); rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config); if (IS_ERR(rdev)) { dev_err(&pdev->dev, "Failed to register regulator %s\n", ri->desc.name); Loading @@ -187,21 +187,12 @@ static int aat2870_regulator_probe(struct platform_device *pdev) return 0; } static int aat2870_regulator_remove(struct platform_device *pdev) { struct regulator_dev *rdev = platform_get_drvdata(pdev); regulator_unregister(rdev); return 0; } static struct platform_driver aat2870_regulator_driver = { .driver = { .name = "aat2870-regulator", .owner = THIS_MODULE, }, .probe = aat2870_regulator_probe, .remove = aat2870_regulator_remove, }; static int __init aat2870_regulator_init(void) Loading
drivers/regulator/ad5398.c +3 −16 Original line number Diff line number Diff line Loading @@ -219,7 +219,6 @@ static int ad5398_probe(struct i2c_client *client, struct ad5398_chip_info *chip; const struct ad5398_current_data_format *df = (struct ad5398_current_data_format *)id->driver_data; int ret; if (!init_data) return -EINVAL; Loading @@ -240,33 +239,21 @@ static int ad5398_probe(struct i2c_client *client, chip->current_offset = df->current_offset; chip->current_mask = (chip->current_level - 1) << chip->current_offset; chip->rdev = regulator_register(&ad5398_reg, &config); chip->rdev = devm_regulator_register(&client->dev, &ad5398_reg, &config); if (IS_ERR(chip->rdev)) { ret = PTR_ERR(chip->rdev); dev_err(&client->dev, "failed to register %s %s\n", id->name, ad5398_reg.name); goto err; return PTR_ERR(chip->rdev); } i2c_set_clientdata(client, chip); dev_dbg(&client->dev, "%s regulator driver is registered.\n", id->name); return 0; err: return ret; } static int ad5398_remove(struct i2c_client *client) { struct ad5398_chip_info *chip = i2c_get_clientdata(client); regulator_unregister(chip->rdev); return 0; } static struct i2c_driver ad5398_driver = { .probe = ad5398_probe, .remove = ad5398_remove, .driver = { .name = "ad5398", }, Loading