Skip to content

Commit 57e5211

Browse files
elfringEduardo Valentin
authored andcommitted
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>
1 parent 748c23d commit 57e5211

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/thermal/ti-soc-thermal/ti-bandgap.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,10 +1214,8 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev)
12141214
}
12151215

12161216
bgp = devm_kzalloc(&pdev->dev, sizeof(*bgp), GFP_KERNEL);
1217-
if (!bgp) {
1218-
dev_err(&pdev->dev, "Unable to allocate mem for driver ref\n");
1217+
if (!bgp)
12191218
return ERR_PTR(-ENOMEM);
1220-
}
12211219

12221220
of_id = of_match_device(of_ti_bandgap_match, &pdev->dev);
12231221
if (of_id)
@@ -1226,10 +1224,8 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev)
12261224
/* register shadow for context save and restore */
12271225
bgp->regval = devm_kcalloc(&pdev->dev, bgp->conf->sensor_count,
12281226
sizeof(*bgp->regval), GFP_KERNEL);
1229-
if (!bgp->regval) {
1230-
dev_err(&pdev->dev, "Unable to allocate mem for driver ref\n");
1227+
if (!bgp->regval)
12311228
return ERR_PTR(-ENOMEM);
1232-
}
12331229

12341230
i = 0;
12351231
do {

0 commit comments

Comments
 (0)