Regulators: pcap-regulator - clean up driver data after removal
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 24 Feb 2010 07:38:33 +0000 (23:38 -0800)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Wed, 3 Mar 2010 14:49:29 +0000 (14:49 +0000)
It is a good tone to reset driver data after unbinding the device.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/pcap-regulator.c

index 33d7d899e03073597b1f80f5ab10e85925b6e0c8..29d0566379ae452fb3a771747b49abad92a73333 100644 (file)
@@ -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)