Skip to content

Commit 7740ab8

Browse files
Emantorbroonie
authored andcommitted
regulator: fixed: use dev_err_probe for gpio
Instead of returning the the PTR_ERR directly, use dev_err_probe which will also correctly set the deferred probe reason in /sys/kernel/debug/deferred_devices, making it easier to debug missing devices on the system. Signed-off-by: Rouven Czerwinski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 830c364 commit 7740ab8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/regulator/fixed.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
271271
*/
272272
cfg.ena_gpiod = gpiod_get_optional(&pdev->dev, NULL, gflags);
273273
if (IS_ERR(cfg.ena_gpiod))
274-
return PTR_ERR(cfg.ena_gpiod);
274+
return dev_err_probe(&pdev->dev, PTR_ERR(cfg.ena_gpiod),
275+
"can't get GPIO\n");
275276

276277
cfg.dev = &pdev->dev;
277278
cfg.init_data = config->init_data;

0 commit comments

Comments
 (0)