Skip to content

Commit 0d1e68f

Browse files
whameBartosz Golaszewski
authored andcommitted
gpio: twl4030: Remove error print for devm_add_action_or_reset()
When `devm_add_action_or_reset()` fails, it is due to a failed memory allocation and will thus return `-ENOMEM`. `dev_err_probe()` doesn't do anything when error is `-ENOMEM`. Therefore, remove the useless call to `dev_err_probe()` when `devm_add_action_or_reset()` fails, and just return the value instead. Signed-off-by: Waqar Hameed <waqar.hameed@axis.com> Link: https://lore.kernel.org/r/pndjz3im7te.a.out@axis.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 7ce73ee commit 0d1e68f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/gpio/gpio-twl4030.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,7 @@ static int gpio_twl4030_probe(struct platform_device *pdev)
597597

598598
ret = devm_add_action_or_reset(&pdev->dev, gpio_twl4030_power_off_action, d);
599599
if (ret)
600-
return dev_err_probe(&pdev->dev, ret,
601-
"failed to install power off handler\n");
602-
600+
return ret;
603601
}
604602

605603
return 0;

0 commit comments

Comments
 (0)