regulator: tps6507x - add missing platform_set_drvdata in tps6507x_pmic_probe
PATCH 1/1 regulator: tps6507x - add missing platform_set_drvdata in tps6507x_pmic_probe
We should call platform_set_drvdata() before calling platform_get_drvdata().
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/tps6507x-regulator.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/regulator/tps6507x-regulator.c +2 -0
@@ -614,6 +614,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev) } tps6507x_dev->pmic = tps; +platform_set_drvdata (pdev, tps6507x_dev);return 0 ;
@@ -640,6 +641,7 @@ static int __devexit tps6507x_pmic_remove(struct platform_device *pdev)for (i =0 ; i <TPS6507X_NUM_REGULATOR ; i++)regulator_unregister (tps->rdev[i]); +platform_set_drvdata (pdev,NULL );kfree (tps);return 0 ;
Signature · 1 line
1.5.4.3
Quoted 20 lines · Axel Lin
We should call
platform_set_drvdata()before callingplatform_get_drvdata().Signed-off-by Axel Lin <[email protected]>---
drivers/regulator/tps6507x-regulator.c| 2 ++1 files changed, 2 insertions(+), 0 deletions(-)drivers/regulator/tps6507x-regulator.c +1
-0@@ -614,6 +614,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev) } tps6507x_dev->pmic = tps; +platform_set_drvdata (pdev, tps6507x_dev);return 0 ;
drivers/regulator/tps6507x-regulator.c static int __devexit tps6507x_pmic_remove(struct platform_device *pdev) · line 645
Quoted 5 lines
drivers/regulator/tps6507x-regulator.c +1
-0@@ -640,6 +641,7 @@ static int __devexit tps6507x_pmic_remove(struct platform_device *pdev)for (i =0 ; i <TPS6507X_NUM_REGULATOR ; i++)regulator_unregister (tps->rdev[i]); +platform_set_drvdata (pdev,NULL );kfree (tps);
This is not needed - we're unbinding the driver so should no longer be looking at the driver data.
Quoted 7 lines
drivers/regulator/tps6507x-regulator.c +0
-0return 0 ;Signature · 1 line
1.5.4.3