diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-02-24 02:38:39 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-03-03 09:49:29 -0500 |
commit | eb66d565e8eb73ab0c471fd3dac822dc663fe8ea (patch) | |
tree | 91ffe5e5ad07017f90c52ef579348ef4d050a58a /drivers/regulator | |
parent | 6a74857d1b75e4f58f1a09472b972058499258a4 (diff) |
Regulators: wm831x-xxx - clean up driver data after removal
It is a good tone to reset driver data after unbinding the device.
Also set up drivers owner.
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>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/wm831x-dcdc.c | 12 | ||||
-rw-r--r-- | drivers/regulator/wm831x-isink.c | 3 | ||||
-rw-r--r-- | drivers/regulator/wm831x-ldo.c | 5 |
3 files changed, 20 insertions, 0 deletions
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 0a6577577e8d..6e18e56d850b 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c | |||
@@ -600,6 +600,8 @@ static __devexit int wm831x_buckv_remove(struct platform_device *pdev) | |||
600 | struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); | 600 | struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); |
601 | struct wm831x *wm831x = dcdc->wm831x; | 601 | struct wm831x *wm831x = dcdc->wm831x; |
602 | 602 | ||
603 | platform_set_drvdata(pdev, NULL); | ||
604 | |||
603 | wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "HC"), dcdc); | 605 | wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "HC"), dcdc); |
604 | wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc); | 606 | wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc); |
605 | regulator_unregister(dcdc->regulator); | 607 | regulator_unregister(dcdc->regulator); |
@@ -615,6 +617,7 @@ static struct platform_driver wm831x_buckv_driver = { | |||
615 | .remove = __devexit_p(wm831x_buckv_remove), | 617 | .remove = __devexit_p(wm831x_buckv_remove), |
616 | .driver = { | 618 | .driver = { |
617 | .name = "wm831x-buckv", | 619 | .name = "wm831x-buckv", |
620 | .owner = THIS_MODULE, | ||
618 | }, | 621 | }, |
619 | }; | 622 | }; |
620 | 623 | ||
@@ -769,6 +772,8 @@ static __devexit int wm831x_buckp_remove(struct platform_device *pdev) | |||
769 | struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); | 772 | struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); |
770 | struct wm831x *wm831x = dcdc->wm831x; | 773 | struct wm831x *wm831x = dcdc->wm831x; |
771 | 774 | ||
775 | platform_set_drvdata(pdev, NULL); | ||
776 | |||
772 | wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc); | 777 | wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc); |
773 | regulator_unregister(dcdc->regulator); | 778 | regulator_unregister(dcdc->regulator); |
774 | kfree(dcdc); | 779 | kfree(dcdc); |
@@ -781,6 +786,7 @@ static struct platform_driver wm831x_buckp_driver = { | |||
781 | .remove = __devexit_p(wm831x_buckp_remove), | 786 | .remove = __devexit_p(wm831x_buckp_remove), |
782 | .driver = { | 787 | .driver = { |
783 | .name = "wm831x-buckp", | 788 | .name = "wm831x-buckp", |
789 | .owner = THIS_MODULE, | ||
784 | }, | 790 | }, |
785 | }; | 791 | }; |
786 | 792 | ||
@@ -895,6 +901,8 @@ static __devexit int wm831x_boostp_remove(struct platform_device *pdev) | |||
895 | struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); | 901 | struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); |
896 | struct wm831x *wm831x = dcdc->wm831x; | 902 | struct wm831x *wm831x = dcdc->wm831x; |
897 | 903 | ||
904 | platform_set_drvdata(pdev, NULL); | ||
905 | |||
898 | wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc); | 906 | wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc); |
899 | regulator_unregister(dcdc->regulator); | 907 | regulator_unregister(dcdc->regulator); |
900 | kfree(dcdc); | 908 | kfree(dcdc); |
@@ -907,6 +915,7 @@ static struct platform_driver wm831x_boostp_driver = { | |||
907 | .remove = __devexit_p(wm831x_boostp_remove), | 915 | .remove = __devexit_p(wm831x_boostp_remove), |
908 | .driver = { | 916 | .driver = { |
909 | .name = "wm831x-boostp", | 917 | .name = "wm831x-boostp", |
918 | .owner = THIS_MODULE, | ||
910 | }, | 919 | }, |
911 | }; | 920 | }; |
912 | 921 | ||
@@ -979,6 +988,8 @@ static __devexit int wm831x_epe_remove(struct platform_device *pdev) | |||
979 | { | 988 | { |
980 | struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); | 989 | struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); |
981 | 990 | ||
991 | platform_set_drvdata(pdev, NULL); | ||
992 | |||
982 | regulator_unregister(dcdc->regulator); | 993 | regulator_unregister(dcdc->regulator); |
983 | kfree(dcdc); | 994 | kfree(dcdc); |
984 | 995 | ||
@@ -990,6 +1001,7 @@ static struct platform_driver wm831x_epe_driver = { | |||
990 | .remove = __devexit_p(wm831x_epe_remove), | 1001 | .remove = __devexit_p(wm831x_epe_remove), |
991 | .driver = { | 1002 | .driver = { |
992 | .name = "wm831x-epe", | 1003 | .name = "wm831x-epe", |
1004 | .owner = THIS_MODULE, | ||
993 | }, | 1005 | }, |
994 | }; | 1006 | }; |
995 | 1007 | ||
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c index 48857008758c..ca0f6b6c384b 100644 --- a/drivers/regulator/wm831x-isink.c +++ b/drivers/regulator/wm831x-isink.c | |||
@@ -222,6 +222,8 @@ static __devexit int wm831x_isink_remove(struct platform_device *pdev) | |||
222 | struct wm831x_isink *isink = platform_get_drvdata(pdev); | 222 | struct wm831x_isink *isink = platform_get_drvdata(pdev); |
223 | struct wm831x *wm831x = isink->wm831x; | 223 | struct wm831x *wm831x = isink->wm831x; |
224 | 224 | ||
225 | platform_set_drvdata(pdev, NULL); | ||
226 | |||
225 | wm831x_free_irq(wm831x, platform_get_irq(pdev, 0), isink); | 227 | wm831x_free_irq(wm831x, platform_get_irq(pdev, 0), isink); |
226 | 228 | ||
227 | regulator_unregister(isink->regulator); | 229 | regulator_unregister(isink->regulator); |
@@ -235,6 +237,7 @@ static struct platform_driver wm831x_isink_driver = { | |||
235 | .remove = __devexit_p(wm831x_isink_remove), | 237 | .remove = __devexit_p(wm831x_isink_remove), |
236 | .driver = { | 238 | .driver = { |
237 | .name = "wm831x-isink", | 239 | .name = "wm831x-isink", |
240 | .owner = THIS_MODULE, | ||
238 | }, | 241 | }, |
239 | }; | 242 | }; |
240 | 243 | ||
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c index 61e02ac2fda3..d2406c1519a1 100644 --- a/drivers/regulator/wm831x-ldo.c +++ b/drivers/regulator/wm831x-ldo.c | |||
@@ -371,6 +371,8 @@ static __devexit int wm831x_gp_ldo_remove(struct platform_device *pdev) | |||
371 | struct wm831x_ldo *ldo = platform_get_drvdata(pdev); | 371 | struct wm831x_ldo *ldo = platform_get_drvdata(pdev); |
372 | struct wm831x *wm831x = ldo->wm831x; | 372 | struct wm831x *wm831x = ldo->wm831x; |
373 | 373 | ||
374 | platform_set_drvdata(pdev, NULL); | ||
375 | |||
374 | wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), ldo); | 376 | wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), ldo); |
375 | regulator_unregister(ldo->regulator); | 377 | regulator_unregister(ldo->regulator); |
376 | kfree(ldo); | 378 | kfree(ldo); |
@@ -383,6 +385,7 @@ static struct platform_driver wm831x_gp_ldo_driver = { | |||
383 | .remove = __devexit_p(wm831x_gp_ldo_remove), | 385 | .remove = __devexit_p(wm831x_gp_ldo_remove), |
384 | .driver = { | 386 | .driver = { |
385 | .name = "wm831x-ldo", | 387 | .name = "wm831x-ldo", |
388 | .owner = THIS_MODULE, | ||
386 | }, | 389 | }, |
387 | }; | 390 | }; |
388 | 391 | ||
@@ -640,6 +643,7 @@ static struct platform_driver wm831x_aldo_driver = { | |||
640 | .remove = __devexit_p(wm831x_aldo_remove), | 643 | .remove = __devexit_p(wm831x_aldo_remove), |
641 | .driver = { | 644 | .driver = { |
642 | .name = "wm831x-aldo", | 645 | .name = "wm831x-aldo", |
646 | .owner = THIS_MODULE, | ||
643 | }, | 647 | }, |
644 | }; | 648 | }; |
645 | 649 | ||
@@ -811,6 +815,7 @@ static struct platform_driver wm831x_alive_ldo_driver = { | |||
811 | .remove = __devexit_p(wm831x_alive_ldo_remove), | 815 | .remove = __devexit_p(wm831x_alive_ldo_remove), |
812 | .driver = { | 816 | .driver = { |
813 | .name = "wm831x-alive-ldo", | 817 | .name = "wm831x-alive-ldo", |
818 | .owner = THIS_MODULE, | ||
814 | }, | 819 | }, |
815 | }; | 820 | }; |
816 | 821 | ||