diff options
Diffstat (limited to 'drivers/regulator/ab8500.c')
-rw-r--r-- | drivers/regulator/ab8500.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index c7784c4bff4f..f7d1f538c200 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c | |||
@@ -939,8 +939,9 @@ ab8500_regulator_of_probe(struct platform_device *pdev, struct device_node *np) | |||
939 | static int ab8500_regulator_probe(struct platform_device *pdev) | 939 | static int ab8500_regulator_probe(struct platform_device *pdev) |
940 | { | 940 | { |
941 | struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); | 941 | struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); |
942 | struct ab8500_platform_data *pdata; | ||
943 | struct device_node *np = pdev->dev.of_node; | 942 | struct device_node *np = pdev->dev.of_node; |
943 | struct ab8500_platform_data *ppdata; | ||
944 | struct ab8500_regulator_platform_data *pdata; | ||
944 | int i, err; | 945 | int i, err; |
945 | 946 | ||
946 | if (np) { | 947 | if (np) { |
@@ -961,7 +962,14 @@ static int ab8500_regulator_probe(struct platform_device *pdev) | |||
961 | dev_err(&pdev->dev, "null mfd parent\n"); | 962 | dev_err(&pdev->dev, "null mfd parent\n"); |
962 | return -EINVAL; | 963 | return -EINVAL; |
963 | } | 964 | } |
964 | pdata = dev_get_platdata(ab8500->dev); | 965 | |
966 | ppdata = dev_get_platdata(ab8500->dev); | ||
967 | if (!ppdata) { | ||
968 | dev_err(&pdev->dev, "null parent pdata\n"); | ||
969 | return -EINVAL; | ||
970 | } | ||
971 | |||
972 | pdata = ppdata->regulator; | ||
965 | if (!pdata) { | 973 | if (!pdata) { |
966 | dev_err(&pdev->dev, "null pdata\n"); | 974 | dev_err(&pdev->dev, "null pdata\n"); |
967 | return -EINVAL; | 975 | return -EINVAL; |
@@ -974,12 +982,12 @@ static int ab8500_regulator_probe(struct platform_device *pdev) | |||
974 | } | 982 | } |
975 | 983 | ||
976 | /* initialize registers */ | 984 | /* initialize registers */ |
977 | for (i = 0; i < pdata->num_regulator_reg_init; i++) { | 985 | for (i = 0; i < pdata->num_reg_init; i++) { |
978 | int id, mask, value; | 986 | int id, mask, value; |
979 | 987 | ||
980 | id = pdata->regulator_reg_init[i].id; | 988 | id = pdata->reg_init[i].id; |
981 | mask = pdata->regulator_reg_init[i].mask; | 989 | mask = pdata->reg_init[i].mask; |
982 | value = pdata->regulator_reg_init[i].value; | 990 | value = pdata->reg_init[i].value; |
983 | 991 | ||
984 | /* check for configuration errors */ | 992 | /* check for configuration errors */ |
985 | BUG_ON(id >= AB8500_NUM_REGULATOR_REGISTERS); | 993 | BUG_ON(id >= AB8500_NUM_REGULATOR_REGISTERS); |
@@ -1045,5 +1053,6 @@ module_exit(ab8500_regulator_exit); | |||
1045 | 1053 | ||
1046 | MODULE_LICENSE("GPL v2"); | 1054 | MODULE_LICENSE("GPL v2"); |
1047 | MODULE_AUTHOR("Sundar Iyer <sundar.iyer@stericsson.com>"); | 1055 | MODULE_AUTHOR("Sundar Iyer <sundar.iyer@stericsson.com>"); |
1056 | MODULE_AUTHOR("Bengt Jonsson <bengt.g.jonsson@stericsson.com>"); | ||
1048 | MODULE_DESCRIPTION("Regulator Driver for ST-Ericsson AB8500 Mixed-Sig PMIC"); | 1057 | MODULE_DESCRIPTION("Regulator Driver for ST-Ericsson AB8500 Mixed-Sig PMIC"); |
1049 | MODULE_ALIAS("platform:ab8500-regulator"); | 1058 | MODULE_ALIAS("platform:ab8500-regulator"); |