summaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-08-29 14:43:56 +0200
committerChanwoo Choi <cw00.choi@samsung.com>2020-09-24 12:20:49 +0200
commitce90c3c9b3ab2e25530a9bb313f3c51718d5d96b (patch)
treeb6ae3bdff47d5a71331e40bc3066a873a252ff15 /drivers/extcon
parentextcon: max77843: Return error code of extcon_dev_allocate() (diff)
downloadlinux-ce90c3c9b3ab2e25530a9bb313f3c51718d5d96b.tar.xz
linux-ce90c3c9b3ab2e25530a9bb313f3c51718d5d96b.zip
extcon: max8997: 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. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/extcon-max8997.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 172e116ac1ce..337b0eea4e62 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -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;
}