diff options
Diffstat (limited to 'drivers/regulator/tps65090-regulator.c')
-rw-r--r-- | drivers/regulator/tps65090-regulator.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/regulator/tps65090-regulator.c b/drivers/regulator/tps65090-regulator.c index 676f75548f00..2e92ef68574d 100644 --- a/drivers/regulator/tps65090-regulator.c +++ b/drivers/regulator/tps65090-regulator.c | |||
@@ -168,17 +168,13 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data( | |||
168 | 168 | ||
169 | tps65090_pdata = devm_kzalloc(&pdev->dev, sizeof(*tps65090_pdata), | 169 | tps65090_pdata = devm_kzalloc(&pdev->dev, sizeof(*tps65090_pdata), |
170 | GFP_KERNEL); | 170 | GFP_KERNEL); |
171 | if (!tps65090_pdata) { | 171 | if (!tps65090_pdata) |
172 | dev_err(&pdev->dev, "Memory alloc for tps65090_pdata failed\n"); | ||
173 | return ERR_PTR(-ENOMEM); | 172 | return ERR_PTR(-ENOMEM); |
174 | } | ||
175 | 173 | ||
176 | reg_pdata = devm_kzalloc(&pdev->dev, TPS65090_REGULATOR_MAX * | 174 | reg_pdata = devm_kzalloc(&pdev->dev, TPS65090_REGULATOR_MAX * |
177 | sizeof(*reg_pdata), GFP_KERNEL); | 175 | sizeof(*reg_pdata), GFP_KERNEL); |
178 | if (!reg_pdata) { | 176 | if (!reg_pdata) |
179 | dev_err(&pdev->dev, "Memory alloc for reg_pdata failed\n"); | ||
180 | return ERR_PTR(-ENOMEM); | 177 | return ERR_PTR(-ENOMEM); |
181 | } | ||
182 | 178 | ||
183 | regulators = of_get_child_by_name(np, "regulators"); | 179 | regulators = of_get_child_by_name(np, "regulators"); |
184 | if (!regulators) { | 180 | if (!regulators) { |
@@ -188,6 +184,7 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data( | |||
188 | 184 | ||
189 | ret = of_regulator_match(&pdev->dev, regulators, tps65090_matches, | 185 | ret = of_regulator_match(&pdev->dev, regulators, tps65090_matches, |
190 | ARRAY_SIZE(tps65090_matches)); | 186 | ARRAY_SIZE(tps65090_matches)); |
187 | of_node_put(regulators); | ||
191 | if (ret < 0) { | 188 | if (ret < 0) { |
192 | dev_err(&pdev->dev, | 189 | dev_err(&pdev->dev, |
193 | "Error parsing regulator init data: %d\n", ret); | 190 | "Error parsing regulator init data: %d\n", ret); |
@@ -252,10 +249,8 @@ static int tps65090_regulator_probe(struct platform_device *pdev) | |||
252 | 249 | ||
253 | pmic = devm_kzalloc(&pdev->dev, TPS65090_REGULATOR_MAX * sizeof(*pmic), | 250 | pmic = devm_kzalloc(&pdev->dev, TPS65090_REGULATOR_MAX * sizeof(*pmic), |
254 | GFP_KERNEL); | 251 | GFP_KERNEL); |
255 | if (!pmic) { | 252 | if (!pmic) |
256 | dev_err(&pdev->dev, "mem alloc for pmic failed\n"); | ||
257 | return -ENOMEM; | 253 | return -ENOMEM; |
258 | } | ||
259 | 254 | ||
260 | for (num = 0; num < TPS65090_REGULATOR_MAX; num++) { | 255 | for (num = 0; num < TPS65090_REGULATOR_MAX; num++) { |
261 | tps_pdata = tps65090_pdata->reg_pdata[num]; | 256 | tps_pdata = tps65090_pdata->reg_pdata[num]; |