Commit fae3b83645ec37b4f274b0bb9c602152ae10ece5
Committed by
Mark Brown
1 parent
d718debcdb
Exists in
master
and in
13 other branches
regulator: wm831x-ldo: Remove redundant error message
kzalloc prints its own OOM message upon failure. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
Showing 1 changed file with 3 additions and 9 deletions Side-by-side Diff
drivers/regulator/wm831x-ldo.c
... | ... | @@ -235,10 +235,8 @@ |
235 | 235 | dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1); |
236 | 236 | |
237 | 237 | ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL); |
238 | - if (ldo == NULL) { | |
239 | - dev_err(&pdev->dev, "Unable to allocate private data\n"); | |
238 | + if (!ldo) | |
240 | 239 | return -ENOMEM; |
241 | - } | |
242 | 240 | |
243 | 241 | ldo->wm831x = wm831x; |
244 | 242 | |
245 | 243 | |
... | ... | @@ -447,10 +445,8 @@ |
447 | 445 | dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1); |
448 | 446 | |
449 | 447 | ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL); |
450 | - if (ldo == NULL) { | |
451 | - dev_err(&pdev->dev, "Unable to allocate private data\n"); | |
448 | + if (!ldo) | |
452 | 449 | return -ENOMEM; |
453 | - } | |
454 | 450 | |
455 | 451 | ldo->wm831x = wm831x; |
456 | 452 | |
457 | 453 | |
... | ... | @@ -594,10 +590,8 @@ |
594 | 590 | dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1); |
595 | 591 | |
596 | 592 | ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ldo), GFP_KERNEL); |
597 | - if (ldo == NULL) { | |
598 | - dev_err(&pdev->dev, "Unable to allocate private data\n"); | |
593 | + if (!ldo) | |
599 | 594 | return -ENOMEM; |
600 | - } | |
601 | 595 | |
602 | 596 | ldo->wm831x = wm831x; |
603 | 597 |