Commit eb66d565 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Liam Girdwood

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: default avatarDmitry Torokhov <dtor@mail.ru>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 6a74857d
...@@ -600,6 +600,8 @@ static __devexit int wm831x_buckv_remove(struct platform_device *pdev) ...@@ -600,6 +600,8 @@ static __devexit int wm831x_buckv_remove(struct platform_device *pdev)
struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev);
struct wm831x *wm831x = dcdc->wm831x; struct wm831x *wm831x = dcdc->wm831x;
platform_set_drvdata(pdev, NULL);
wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "HC"), dcdc); wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "HC"), dcdc);
wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc); wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc);
regulator_unregister(dcdc->regulator); regulator_unregister(dcdc->regulator);
...@@ -615,6 +617,7 @@ static struct platform_driver wm831x_buckv_driver = { ...@@ -615,6 +617,7 @@ static struct platform_driver wm831x_buckv_driver = {
.remove = __devexit_p(wm831x_buckv_remove), .remove = __devexit_p(wm831x_buckv_remove),
.driver = { .driver = {
.name = "wm831x-buckv", .name = "wm831x-buckv",
.owner = THIS_MODULE,
}, },
}; };
...@@ -769,6 +772,8 @@ static __devexit int wm831x_buckp_remove(struct platform_device *pdev) ...@@ -769,6 +772,8 @@ static __devexit int wm831x_buckp_remove(struct platform_device *pdev)
struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev);
struct wm831x *wm831x = dcdc->wm831x; struct wm831x *wm831x = dcdc->wm831x;
platform_set_drvdata(pdev, NULL);
wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc); wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc);
regulator_unregister(dcdc->regulator); regulator_unregister(dcdc->regulator);
kfree(dcdc); kfree(dcdc);
...@@ -781,6 +786,7 @@ static struct platform_driver wm831x_buckp_driver = { ...@@ -781,6 +786,7 @@ static struct platform_driver wm831x_buckp_driver = {
.remove = __devexit_p(wm831x_buckp_remove), .remove = __devexit_p(wm831x_buckp_remove),
.driver = { .driver = {
.name = "wm831x-buckp", .name = "wm831x-buckp",
.owner = THIS_MODULE,
}, },
}; };
...@@ -895,6 +901,8 @@ static __devexit int wm831x_boostp_remove(struct platform_device *pdev) ...@@ -895,6 +901,8 @@ static __devexit int wm831x_boostp_remove(struct platform_device *pdev)
struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev);
struct wm831x *wm831x = dcdc->wm831x; struct wm831x *wm831x = dcdc->wm831x;
platform_set_drvdata(pdev, NULL);
wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc); wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), dcdc);
regulator_unregister(dcdc->regulator); regulator_unregister(dcdc->regulator);
kfree(dcdc); kfree(dcdc);
...@@ -907,6 +915,7 @@ static struct platform_driver wm831x_boostp_driver = { ...@@ -907,6 +915,7 @@ static struct platform_driver wm831x_boostp_driver = {
.remove = __devexit_p(wm831x_boostp_remove), .remove = __devexit_p(wm831x_boostp_remove),
.driver = { .driver = {
.name = "wm831x-boostp", .name = "wm831x-boostp",
.owner = THIS_MODULE,
}, },
}; };
...@@ -979,6 +988,8 @@ static __devexit int wm831x_epe_remove(struct platform_device *pdev) ...@@ -979,6 +988,8 @@ static __devexit int wm831x_epe_remove(struct platform_device *pdev)
{ {
struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev); struct wm831x_dcdc *dcdc = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
regulator_unregister(dcdc->regulator); regulator_unregister(dcdc->regulator);
kfree(dcdc); kfree(dcdc);
...@@ -990,6 +1001,7 @@ static struct platform_driver wm831x_epe_driver = { ...@@ -990,6 +1001,7 @@ static struct platform_driver wm831x_epe_driver = {
.remove = __devexit_p(wm831x_epe_remove), .remove = __devexit_p(wm831x_epe_remove),
.driver = { .driver = {
.name = "wm831x-epe", .name = "wm831x-epe",
.owner = THIS_MODULE,
}, },
}; };
......
...@@ -222,6 +222,8 @@ static __devexit int wm831x_isink_remove(struct platform_device *pdev) ...@@ -222,6 +222,8 @@ static __devexit int wm831x_isink_remove(struct platform_device *pdev)
struct wm831x_isink *isink = platform_get_drvdata(pdev); struct wm831x_isink *isink = platform_get_drvdata(pdev);
struct wm831x *wm831x = isink->wm831x; struct wm831x *wm831x = isink->wm831x;
platform_set_drvdata(pdev, NULL);
wm831x_free_irq(wm831x, platform_get_irq(pdev, 0), isink); wm831x_free_irq(wm831x, platform_get_irq(pdev, 0), isink);
regulator_unregister(isink->regulator); regulator_unregister(isink->regulator);
...@@ -235,6 +237,7 @@ static struct platform_driver wm831x_isink_driver = { ...@@ -235,6 +237,7 @@ static struct platform_driver wm831x_isink_driver = {
.remove = __devexit_p(wm831x_isink_remove), .remove = __devexit_p(wm831x_isink_remove),
.driver = { .driver = {
.name = "wm831x-isink", .name = "wm831x-isink",
.owner = THIS_MODULE,
}, },
}; };
......
...@@ -371,6 +371,8 @@ static __devexit int wm831x_gp_ldo_remove(struct platform_device *pdev) ...@@ -371,6 +371,8 @@ static __devexit int wm831x_gp_ldo_remove(struct platform_device *pdev)
struct wm831x_ldo *ldo = platform_get_drvdata(pdev); struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
struct wm831x *wm831x = ldo->wm831x; struct wm831x *wm831x = ldo->wm831x;
platform_set_drvdata(pdev, NULL);
wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), ldo); wm831x_free_irq(wm831x, platform_get_irq_byname(pdev, "UV"), ldo);
regulator_unregister(ldo->regulator); regulator_unregister(ldo->regulator);
kfree(ldo); kfree(ldo);
...@@ -383,6 +385,7 @@ static struct platform_driver wm831x_gp_ldo_driver = { ...@@ -383,6 +385,7 @@ static struct platform_driver wm831x_gp_ldo_driver = {
.remove = __devexit_p(wm831x_gp_ldo_remove), .remove = __devexit_p(wm831x_gp_ldo_remove),
.driver = { .driver = {
.name = "wm831x-ldo", .name = "wm831x-ldo",
.owner = THIS_MODULE,
}, },
}; };
...@@ -640,6 +643,7 @@ static struct platform_driver wm831x_aldo_driver = { ...@@ -640,6 +643,7 @@ static struct platform_driver wm831x_aldo_driver = {
.remove = __devexit_p(wm831x_aldo_remove), .remove = __devexit_p(wm831x_aldo_remove),
.driver = { .driver = {
.name = "wm831x-aldo", .name = "wm831x-aldo",
.owner = THIS_MODULE,
}, },
}; };
...@@ -811,6 +815,7 @@ static struct platform_driver wm831x_alive_ldo_driver = { ...@@ -811,6 +815,7 @@ static struct platform_driver wm831x_alive_ldo_driver = {
.remove = __devexit_p(wm831x_alive_ldo_remove), .remove = __devexit_p(wm831x_alive_ldo_remove),
.driver = { .driver = {
.name = "wm831x-alive-ldo", .name = "wm831x-alive-ldo",
.owner = THIS_MODULE,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment