--- zzzz-none-000/linux-3.10.107/drivers/regulator/pcap-regulator.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/regulator/pcap-regulator.c 2021-02-04 17:41:59.000000000 +0000 @@ -243,10 +243,11 @@ struct regulator_config config = { }; config.dev = &pdev->dev; - config.init_data = pdev->dev.platform_data; + config.init_data = dev_get_platdata(&pdev->dev); config.driver_data = pcap; - rdev = regulator_register(&pcap_regulators[pdev->id], &config); + rdev = devm_regulator_register(&pdev->dev, &pcap_regulators[pdev->id], + &config); if (IS_ERR(rdev)) return PTR_ERR(rdev); @@ -255,23 +256,11 @@ return 0; } -static int pcap_regulator_remove(struct platform_device *pdev) -{ - struct regulator_dev *rdev = platform_get_drvdata(pdev); - - regulator_unregister(rdev); - platform_set_drvdata(pdev, NULL); - - return 0; -} - static struct platform_driver pcap_regulator_driver = { .driver = { .name = "pcap-regulator", - .owner = THIS_MODULE, }, .probe = pcap_regulator_probe, - .remove = pcap_regulator_remove, }; static int __init pcap_regulator_init(void)