Skip to contentSkip to conversation

extcon: max14577: Return error code of extcon_dev_allocate()

PATCH Applied Krzysztof Kozlowski 2 participants 5 messages Aug 29, 2020

Subsystems (2)
lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 1/4 extcon: max14577: Return error code of extcon_dev_allocate()

devm_extcon_dev_allocate() can fail of multiple reasons. The call returns proper error code on failure so pass it instead of fixed ENOMEM.

---
 drivers/extcon/extcon-max14577.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-max14577.c +1 -1
index cc47d626095c..ace523924e58 100644
@@ -713,7 +713,7 @@ static int max14577_muic_probe(struct platform_device *pdev)
 					      max14577_extcon_cable);
 	if (IS_ERR(info->edev)) {
 		dev_err(&pdev->dev, "failed to allocate memory for extcon\n");
-		return -ENOMEM;
+		return PTR_ERR(info->edev);
 	}
 
 	ret = devm_extcon_dev_register(&pdev->dev, info->edev);
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH 2/4 extcon: max77693: Return error code of extcon_dev_allocate()

devm_extcon_dev_allocate() can fail of multiple reasons. The call returns proper error code on failure so pass it instead of fixed ENOMEM.

---
 drivers/extcon/extcon-max77693.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-max77693.c +1 -1
index 32fc5a66ffa9..4a410fd2ea9a 100644
@@ -1157,7 +1157,7 @@ static int max77693_muic_probe(struct platform_device *pdev)
 					      max77693_extcon_cable);
 	if (IS_ERR(info->edev)) {
 		dev_err(&pdev->dev, "failed to allocate memory for extcon\n");
-		return -ENOMEM;
+		return PTR_ERR(info->edev);
 	}
 
 	ret = devm_extcon_dev_register(&pdev->dev, info->edev);
Signature · 1 line
2.17.1
author maintainer
#2 lore raw

PATCH 3/4 extcon: max77843: Return error code of extcon_dev_allocate()

In reply to Krzysztof Kozlowski

devm_extcon_dev_allocate() can fail of multiple reasons. The call returns proper error code on failure so pass it instead of fixed ENOMEM.

---
 drivers/extcon/extcon-max77843.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-max77843.c +1 -1
index e6b50ca83008..8e6e97ec65a8 100644
@@ -845,7 +845,7 @@ static int max77843_muic_probe(struct platform_device *pdev)
 			max77843_extcon_cable);
 	if (IS_ERR(info->edev)) {
 		dev_err(&pdev->dev, "Failed to allocate memory for extcon\n");
-		ret = -ENODEV;
+		ret = PTR_ERR(info->edev);
 		goto err_muic_irq;
 	}
 
Signature · 1 line
2.17.1
author maintainer
#3 lore raw

PATCH 4/4 extcon: max8997: Return error code of extcon_dev_allocate()

In reply to Krzysztof Kozlowski

devm_extcon_dev_allocate() can fail of multiple reasons. The call returns proper error code on failure so pass it instead of fixed ENOMEM.

---
 drivers/extcon/extcon-max8997.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-max8997.c +1 -1
index 172e116ac1ce..337b0eea4e62 100644
@@ -674,7 +674,7 @@ static int max8997_muic_probe(struct platform_device *pdev)
 	info->edev = devm_extcon_dev_allocate(&pdev->dev, max8997_extcon_cable);
 	if (IS_ERR(info->edev)) {
 		dev_err(&pdev->dev, "failed to allocate memory for extcon\n");
-		ret = -ENOMEM;
+		ret = PTR_ERR(info->edev);
 		goto err_irq;
 	}
 
Signature · 1 line
2.17.1
Applied
#4 lore raw
In reply to Krzysztof Kozlowski
Quoted 23 lines · Krzysztof Kozlowski

devm_extcon_dev_allocate() can fail of multiple reasons. The call returns proper error code on failure so pass it instead of fixed ENOMEM.

---
 drivers/extcon/extcon-max14577.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-max14577.c +1 -2
index cc47d626095c..ace523924e58 100644
@@ -713,7 +713,7 @@ static int max14577_muic_probe(struct platform_device *pdev)
                                              max14577_extcon_cable);
        if (IS_ERR(info->edev)) {
                dev_err(&pdev->dev, "failed to allocate memory for extcon\n");
-               return -ENOMEM;
+               return PTR_ERR(info->edev);
        }
 
        ret = devm_extcon_dev_register(&pdev->dev, info->edev);
--
Quoted 2 lines

2.17.1

Applied them for patch1-4. Thanks.

Signature · 3 lines
Best Regards,
Chanwoo Choi
Samsung Electronics