Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
[safe/jmp/linux-2.6] / drivers / regulator / pcap-regulator.c
index fdb9094..29d0566 100644 (file)
@@ -271,7 +271,7 @@ static struct regulator_desc pcap_regulators[] = {
 static int __devinit pcap_regulator_probe(struct platform_device *pdev)
 {
        struct regulator_dev *rdev;
-       void *pcap = platform_get_drvdata(pdev);
+       void *pcap = dev_get_drvdata(pdev->dev.parent);
 
        rdev = regulator_register(&pcap_regulators[pdev->id], &pdev->dev,
                                pdev->dev.platform_data, pcap);
@@ -288,16 +288,18 @@ static int __devexit 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",
+               .name   = "pcap-regulator",
+               .owner  = THIS_MODULE,
        },
-       .probe = pcap_regulator_probe,
-       .remove = __devexit_p(pcap_regulator_remove),
+       .probe  = pcap_regulator_probe,
+       .remove = __devexit_p(pcap_regulator_remove),
 };
 
 static int __init pcap_regulator_init(void)
@@ -310,7 +312,7 @@ static void __exit pcap_regulator_exit(void)
        platform_driver_unregister(&pcap_regulator_driver);
 }
 
-module_init(pcap_regulator_init);
+subsys_initcall(pcap_regulator_init);
 module_exit(pcap_regulator_exit);
 
 MODULE_AUTHOR("Daniel Ribeiro <drwyrm@gmail.com>");