--- zzzz-none-000/linux-3.10.107/drivers/regulator/pcf50633-regulator.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/regulator/pcf50633-regulator.c 2021-02-04 17:41:59.000000000 +0000 @@ -86,11 +86,12 @@ pcf = dev_to_pcf50633(pdev->dev.parent); config.dev = &pdev->dev; - config.init_data = pdev->dev.platform_data; + config.init_data = dev_get_platdata(&pdev->dev); config.driver_data = pcf; config.regmap = pcf->regmap; - rdev = regulator_register(®ulators[pdev->id], &config); + rdev = devm_regulator_register(&pdev->dev, ®ulators[pdev->id], + &config); if (IS_ERR(rdev)) return PTR_ERR(rdev); @@ -102,22 +103,11 @@ return 0; } -static int pcf50633_regulator_remove(struct platform_device *pdev) -{ - struct regulator_dev *rdev = platform_get_drvdata(pdev); - - platform_set_drvdata(pdev, NULL); - regulator_unregister(rdev); - - return 0; -} - static struct platform_driver pcf50633_regulator_driver = { .driver = { - .name = "pcf50633-regltr", + .name = "pcf50633-regulator", }, .probe = pcf50633_regulator_probe, - .remove = pcf50633_regulator_remove, }; static int __init pcf50633_regulator_init(void)