Skip to contentSkip to conversation

extcon: Remove unnecessary OOM messages

PATCH In review Jingoo Han 3 participants 3 messages Jun 18, 2014 – Jun 20, 2014

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 extcon: Remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. The following checkpatch warning is also removed.

WARNING: Possible unnecessary 'out of memory' message

---
 drivers/extcon/extcon-arizona.c  |    4 +---
 drivers/extcon/extcon-max14577.c |    5 ++---
 drivers/extcon/extcon-max77693.c |    5 ++---
 drivers/extcon/extcon-max8997.c  |    4 +---
 4 files changed, 6 insertions(+), 12 deletions(-)
drivers/extcon/extcon-arizona.c +1 -3
index 6c84e3d..90223a3 100644
@@ -1103,10 +1103,8 @@ static int arizona_extcon_probe(struct platform_device *pdev)
 		return -EPROBE_DEFER;
 
 	info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
-	if (!info) {
-		dev_err(&pdev->dev, "Failed to allocate memory\n");
+	if (!info)
 		return -ENOMEM;
-	}
 
 	info->micvdd = devm_regulator_get(arizona->dev, "MICVDD");
 	if (IS_ERR(info->micvdd)) {
drivers/extcon/extcon-max14577.c +2 -3
index d49e891..7309743 100644
@@ -692,10 +692,9 @@ static int max14577_muic_probe(struct platform_device *pdev)
 	u8 id;
 
 	info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
-	if (!info) {
-		dev_err(&pdev->dev, "failed to allocate memory\n");
+	if (!info)
 		return -ENOMEM;
-	}
+
 	info->dev = &pdev->dev;
 	info->max14577 = max14577;
 
drivers/extcon/extcon-max77693.c +2 -3
index 2c7c3e1..47998a2 100644
@@ -1099,10 +1099,9 @@ static int max77693_muic_probe(struct platform_device *pdev)
 
 	info = devm_kzalloc(&pdev->dev, sizeof(struct max77693_muic_info),
 				   GFP_KERNEL);
-	if (!info) {
-		dev_err(&pdev->dev, "failed to allocate memory\n");
+	if (!info)
 		return -ENOMEM;
-	}
+
 	info->dev = &pdev->dev;
 	info->max77693 = max77693;
 	if (info->max77693->regmap_muic) {
drivers/extcon/extcon-max8997.c +1 -3
index d9f7f1b..045e230 100644
@@ -661,10 +661,8 @@ static int max8997_muic_probe(struct platform_device *pdev)
 
 	info = devm_kzalloc(&pdev->dev, sizeof(struct max8997_muic_info),
 			    GFP_KERNEL);
-	if (!info) {
-		dev_err(&pdev->dev, "failed to allocate memory\n");
+	if (!info)
 		return -ENOMEM;
-	}
 
 	info->dev = &pdev->dev;
 	info->muic = max8997->muic;
Signature · 1 line
1.7.10.4
maintainer
#2 lore raw
In reply to Jingoo Han
Quoted 6 lines · Jingoo Han

The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. The following checkpatch warning is also removed.

WARNING: Possible unnecessary 'out of memory' message

Quoted 7 lines
---
 drivers/extcon/extcon-arizona.c  |    4 +---
 drivers/extcon/extcon-max14577.c |    5 ++---
 drivers/extcon/extcon-max77693.c |    5 ++---
 drivers/extcon/extcon-max8997.c  |    4 +---
 4 files changed, 6 insertions(+), 12 deletions(-)

Applied it.

Thanks,
Chanwoo Choi