diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-04-26 11:03:07 -0400 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2017-05-23 23:07:14 -0400 |
commit | 57e521151b56ee0c5164c442b7928c66711bfbc4 (patch) | |
tree | c7deec2e341d3e9d2bd3106281d5fab5c0ecfff3 | |
parent | 748c23d88610b5df378d86e7192e4bd1f58adb35 (diff) |
ti-soc-thermal: Delete error messages for failed memory allocations in ti_bandgap_build()
The script "checkpatch.pl" pointed information out like the following.
WARNING: Possible unnecessary 'out of memory' message
Thus remove such statements here.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Acked-by: Keerthy <j-keerthy@ti.com>
Tested-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r-- | drivers/thermal/ti-soc-thermal/ti-bandgap.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c index f19cb7612a65..109fb0a5f19f 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c | |||
@@ -1214,10 +1214,8 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) | |||
1214 | } | 1214 | } |
1215 | 1215 | ||
1216 | bgp = devm_kzalloc(&pdev->dev, sizeof(*bgp), GFP_KERNEL); | 1216 | bgp = devm_kzalloc(&pdev->dev, sizeof(*bgp), GFP_KERNEL); |
1217 | if (!bgp) { | 1217 | if (!bgp) |
1218 | dev_err(&pdev->dev, "Unable to allocate mem for driver ref\n"); | ||
1219 | return ERR_PTR(-ENOMEM); | 1218 | return ERR_PTR(-ENOMEM); |
1220 | } | ||
1221 | 1219 | ||
1222 | of_id = of_match_device(of_ti_bandgap_match, &pdev->dev); | 1220 | of_id = of_match_device(of_ti_bandgap_match, &pdev->dev); |
1223 | if (of_id) | 1221 | if (of_id) |
@@ -1226,10 +1224,8 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev) | |||
1226 | /* register shadow for context save and restore */ | 1224 | /* register shadow for context save and restore */ |
1227 | bgp->regval = devm_kcalloc(&pdev->dev, bgp->conf->sensor_count, | 1225 | bgp->regval = devm_kcalloc(&pdev->dev, bgp->conf->sensor_count, |
1228 | sizeof(*bgp->regval), GFP_KERNEL); | 1226 | sizeof(*bgp->regval), GFP_KERNEL); |
1229 | if (!bgp->regval) { | 1227 | if (!bgp->regval) |
1230 | dev_err(&pdev->dev, "Unable to allocate mem for driver ref\n"); | ||
1231 | return ERR_PTR(-ENOMEM); | 1228 | return ERR_PTR(-ENOMEM); |
1232 | } | ||
1233 | 1229 | ||
1234 | i = 0; | 1230 | i = 0; |
1235 | do { | 1231 | do { |