Commit 405c5400 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: Remove all platform_set_drvdata(pdev, NULL) in drivers

Since 0998d063 "device-core: Ensure drvdata = NULL when no driver is bound",
this is done by driver core after device_release or on probe failure.
Thus we can remove all platform_set_drvdata(pdev, NULL) in drivers.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent f722406f
...@@ -406,7 +406,6 @@ static int pm8607_regulator_remove(struct platform_device *pdev) ...@@ -406,7 +406,6 @@ static int pm8607_regulator_remove(struct platform_device *pdev)
{ {
struct pm8607_regulator_info *info = platform_get_drvdata(pdev); struct pm8607_regulator_info *info = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
regulator_unregister(info->regulator); regulator_unregister(info->regulator);
return 0; return 0;
} }
......
...@@ -533,7 +533,6 @@ static int lp8788_buck_remove(struct platform_device *pdev) ...@@ -533,7 +533,6 @@ static int lp8788_buck_remove(struct platform_device *pdev)
{ {
struct lp8788_buck *buck = platform_get_drvdata(pdev); struct lp8788_buck *buck = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
regulator_unregister(buck->regulator); regulator_unregister(buck->regulator);
return 0; return 0;
......
...@@ -561,7 +561,6 @@ static int lp8788_dldo_remove(struct platform_device *pdev) ...@@ -561,7 +561,6 @@ static int lp8788_dldo_remove(struct platform_device *pdev)
{ {
struct lp8788_ldo *ldo = platform_get_drvdata(pdev); struct lp8788_ldo *ldo = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
regulator_unregister(ldo->regulator); regulator_unregister(ldo->regulator);
return 0; return 0;
...@@ -622,7 +621,6 @@ static int lp8788_aldo_remove(struct platform_device *pdev) ...@@ -622,7 +621,6 @@ static int lp8788_aldo_remove(struct platform_device *pdev)
{ {
struct lp8788_ldo *ldo = platform_get_drvdata(pdev); struct lp8788_ldo *ldo = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
regulator_unregister(ldo->regulator); regulator_unregister(ldo->regulator);
return 0; return 0;
......
...@@ -327,7 +327,6 @@ static int max8925_regulator_remove(struct platform_device *pdev) ...@@ -327,7 +327,6 @@ static int max8925_regulator_remove(struct platform_device *pdev)
{ {
struct regulator_dev *rdev = platform_get_drvdata(pdev); struct regulator_dev *rdev = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
regulator_unregister(rdev); regulator_unregister(rdev);
return 0; return 0;
......
...@@ -466,8 +466,6 @@ static int mc13783_regulator_remove(struct platform_device *pdev) ...@@ -466,8 +466,6 @@ static int mc13783_regulator_remove(struct platform_device *pdev)
struct mc13xxx_regulator_priv *priv = platform_get_drvdata(pdev); struct mc13xxx_regulator_priv *priv = platform_get_drvdata(pdev);
int i; int i;
platform_set_drvdata(pdev, NULL);
for (i = 0; i < priv->num_regulators; i++) for (i = 0; i < priv->num_regulators; i++)
regulator_unregister(priv->regulators[i]); regulator_unregister(priv->regulators[i]);
......
...@@ -636,8 +636,6 @@ static int mc13892_regulator_remove(struct platform_device *pdev) ...@@ -636,8 +636,6 @@ static int mc13892_regulator_remove(struct platform_device *pdev)
struct mc13xxx_regulator_priv *priv = platform_get_drvdata(pdev); struct mc13xxx_regulator_priv *priv = platform_get_drvdata(pdev);
int i; int i;
platform_set_drvdata(pdev, NULL);
for (i = 0; i < priv->num_regulators; i++) for (i = 0; i < priv->num_regulators; i++)
regulator_unregister(priv->regulators[i]); regulator_unregister(priv->regulators[i]);
......
...@@ -260,7 +260,6 @@ static int pcap_regulator_remove(struct platform_device *pdev) ...@@ -260,7 +260,6 @@ static int pcap_regulator_remove(struct platform_device *pdev)
struct regulator_dev *rdev = platform_get_drvdata(pdev); struct regulator_dev *rdev = platform_get_drvdata(pdev);
regulator_unregister(rdev); regulator_unregister(rdev);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -106,7 +106,6 @@ static int pcf50633_regulator_remove(struct platform_device *pdev) ...@@ -106,7 +106,6 @@ static int pcf50633_regulator_remove(struct platform_device *pdev)
{ {
struct regulator_dev *rdev = platform_get_drvdata(pdev); struct regulator_dev *rdev = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
regulator_unregister(rdev); regulator_unregister(rdev);
return 0; return 0;
......
...@@ -405,8 +405,6 @@ static int tps65217_regulator_remove(struct platform_device *pdev) ...@@ -405,8 +405,6 @@ static int tps65217_regulator_remove(struct platform_device *pdev)
for (i = 0; i < TPS65217_NUM_REGULATOR; i++) for (i = 0; i < TPS65217_NUM_REGULATOR; i++)
regulator_unregister(tps->rdev[i]); regulator_unregister(tps->rdev[i]);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -330,8 +330,6 @@ static int regulator_virtual_remove(struct platform_device *pdev) ...@@ -330,8 +330,6 @@ static int regulator_virtual_remove(struct platform_device *pdev)
if (drvdata->enabled) if (drvdata->enabled)
regulator_disable(drvdata->regulator); regulator_disable(drvdata->regulator);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -567,8 +567,6 @@ static int wm831x_buckv_remove(struct platform_device *pdev) ...@@ -567,8 +567,6 @@ static 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);
free_irq(wm831x_irq(wm831x, platform_get_irq_byname(pdev, "HC")), free_irq(wm831x_irq(wm831x, platform_get_irq_byname(pdev, "HC")),
dcdc); dcdc);
free_irq(wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV")), free_irq(wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV")),
...@@ -714,8 +712,6 @@ static int wm831x_buckp_remove(struct platform_device *pdev) ...@@ -714,8 +712,6 @@ static int wm831x_buckp_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);
free_irq(wm831x_irq(dcdc->wm831x, platform_get_irq_byname(pdev, "UV")), free_irq(wm831x_irq(dcdc->wm831x, platform_get_irq_byname(pdev, "UV")),
dcdc); dcdc);
regulator_unregister(dcdc->regulator); regulator_unregister(dcdc->regulator);
...@@ -849,8 +845,6 @@ static int wm831x_boostp_remove(struct platform_device *pdev) ...@@ -849,8 +845,6 @@ static int wm831x_boostp_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);
free_irq(wm831x_irq(dcdc->wm831x, platform_get_irq_byname(pdev, "UV")), free_irq(wm831x_irq(dcdc->wm831x, platform_get_irq_byname(pdev, "UV")),
dcdc); dcdc);
regulator_unregister(dcdc->regulator); regulator_unregister(dcdc->regulator);
...@@ -940,7 +934,6 @@ static int wm831x_epe_remove(struct platform_device *pdev) ...@@ -940,7 +934,6 @@ static 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);
return 0; return 0;
......
...@@ -225,8 +225,6 @@ static int wm831x_isink_remove(struct platform_device *pdev) ...@@ -225,8 +225,6 @@ static int wm831x_isink_remove(struct platform_device *pdev)
{ {
struct wm831x_isink *isink = platform_get_drvdata(pdev); struct wm831x_isink *isink = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
free_irq(wm831x_irq(isink->wm831x, platform_get_irq(pdev, 0)), isink); free_irq(wm831x_irq(isink->wm831x, platform_get_irq(pdev, 0)), isink);
regulator_unregister(isink->regulator); regulator_unregister(isink->regulator);
......
...@@ -338,8 +338,6 @@ static int wm831x_gp_ldo_remove(struct platform_device *pdev) ...@@ -338,8 +338,6 @@ static 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);
platform_set_drvdata(pdev, NULL);
free_irq(wm831x_irq(ldo->wm831x, free_irq(wm831x_irq(ldo->wm831x,
platform_get_irq_byname(pdev, "UV")), ldo); platform_get_irq_byname(pdev, "UV")), ldo);
regulator_unregister(ldo->regulator); regulator_unregister(ldo->regulator);
......
...@@ -250,7 +250,6 @@ static int wm8400_regulator_remove(struct platform_device *pdev) ...@@ -250,7 +250,6 @@ static int wm8400_regulator_remove(struct platform_device *pdev)
{ {
struct regulator_dev *rdev = platform_get_drvdata(pdev); struct regulator_dev *rdev = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
regulator_unregister(rdev); regulator_unregister(rdev);
return 0; return 0;
......
...@@ -185,8 +185,6 @@ static int wm8994_ldo_remove(struct platform_device *pdev) ...@@ -185,8 +185,6 @@ static int wm8994_ldo_remove(struct platform_device *pdev)
{ {
struct wm8994_ldo *ldo = platform_get_drvdata(pdev); struct wm8994_ldo *ldo = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
regulator_unregister(ldo->regulator); regulator_unregister(ldo->regulator);
return 0; return 0;
......
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