Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: pcap: use devm_regulator_register()

Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

authored by

Jingoo Han and committed by
Mark Brown
15dc006a 58765e24

+2 -11
+2 -11
drivers/regulator/pcap-regulator.c
··· 246 246 config.init_data = dev_get_platdata(&pdev->dev); 247 247 config.driver_data = pcap; 248 248 249 - rdev = regulator_register(&pcap_regulators[pdev->id], &config); 249 + rdev = devm_regulator_register(&pdev->dev, &pcap_regulators[pdev->id], 250 + &config); 250 251 if (IS_ERR(rdev)) 251 252 return PTR_ERR(rdev); 252 253 253 254 platform_set_drvdata(pdev, rdev); 254 - 255 - return 0; 256 - } 257 - 258 - static int pcap_regulator_remove(struct platform_device *pdev) 259 - { 260 - struct regulator_dev *rdev = platform_get_drvdata(pdev); 261 - 262 - regulator_unregister(rdev); 263 255 264 256 return 0; 265 257 } ··· 262 270 .owner = THIS_MODULE, 263 271 }, 264 272 .probe = pcap_regulator_probe, 265 - .remove = pcap_regulator_remove, 266 273 }; 267 274 268 275 static int __init pcap_regulator_init(void)