diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-06-08 10:45:42 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-06-22 06:51:44 -0400 |
commit | a5c1a416013b04b66c721af2e90c04dce604d0b2 (patch) | |
tree | c2924200cb8c58899abad84965495436f94c453f | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) |
regulator: ab8500: Remove ab8500_regulator_of_probe()
Now this is a DT-only driver because non-devicetree probe path is removed,
so merge ab8500_regulator_of_probe() into ab8500_regulator_probe().
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/regulator/ab8500.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index c625468c7f2c..88da8626a57a 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c | |||
@@ -3037,28 +3037,12 @@ static int ab8500_regulator_register(struct platform_device *pdev, | |||
3037 | return 0; | 3037 | return 0; |
3038 | } | 3038 | } |
3039 | 3039 | ||
3040 | static int | ||
3041 | ab8500_regulator_of_probe(struct platform_device *pdev, | ||
3042 | struct device_node *np) | ||
3043 | { | ||
3044 | struct of_regulator_match *match = abx500_regulator.match; | ||
3045 | int err, i; | ||
3046 | |||
3047 | for (i = 0; i < abx500_regulator.info_size; i++) { | ||
3048 | err = ab8500_regulator_register( | ||
3049 | pdev, match[i].init_data, i, match[i].of_node); | ||
3050 | if (err) | ||
3051 | return err; | ||
3052 | } | ||
3053 | |||
3054 | return 0; | ||
3055 | } | ||
3056 | |||
3057 | static int ab8500_regulator_probe(struct platform_device *pdev) | 3040 | static int ab8500_regulator_probe(struct platform_device *pdev) |
3058 | { | 3041 | { |
3059 | struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); | 3042 | struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); |
3060 | struct device_node *np = pdev->dev.of_node; | 3043 | struct device_node *np = pdev->dev.of_node; |
3061 | int err; | 3044 | struct of_regulator_match *match; |
3045 | int err, i; | ||
3062 | 3046 | ||
3063 | if (!ab8500) { | 3047 | if (!ab8500) { |
3064 | dev_err(&pdev->dev, "null mfd parent\n"); | 3048 | dev_err(&pdev->dev, "null mfd parent\n"); |
@@ -3075,7 +3059,16 @@ static int ab8500_regulator_probe(struct platform_device *pdev) | |||
3075 | "Error parsing regulator init data: %d\n", err); | 3059 | "Error parsing regulator init data: %d\n", err); |
3076 | return err; | 3060 | return err; |
3077 | } | 3061 | } |
3078 | return ab8500_regulator_of_probe(pdev, np); | 3062 | |
3063 | match = abx500_regulator.match; | ||
3064 | for (i = 0; i < abx500_regulator.info_size; i++) { | ||
3065 | err = ab8500_regulator_register(pdev, match[i].init_data, i, | ||
3066 | match[i].of_node); | ||
3067 | if (err) | ||
3068 | return err; | ||
3069 | } | ||
3070 | |||
3071 | return 0; | ||
3079 | } | 3072 | } |
3080 | 3073 | ||
3081 | static int ab8500_regulator_remove(struct platform_device *pdev) | 3074 | static int ab8500_regulator_remove(struct platform_device *pdev) |