Skip to content

Commit daeb403

Browse files
Artem Shimkogregkh
authored andcommitted
serial: 8250_dw: handle reset control deassert error
Check the return value of reset_control_deassert() in the probe function to prevent continuing probe when reset deassertion fails. Previously, reset_control_deassert() was called without checking its return value, which could lead to probe continuing even when the device reset wasn't properly deasserted. The fix checks the return value and returns an error with dev_err_probe() if reset deassertion fails, providing better error handling and diagnostics. Fixes: acbdad8 ("serial: 8250_dw: simplify optional reset handling") Cc: stable <[email protected]> Signed-off-by: Artem Shimko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ea9f6d3 commit daeb403

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/tty/serial/8250/8250_dw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,9 @@ static int dw8250_probe(struct platform_device *pdev)
635635
if (IS_ERR(data->rst))
636636
return PTR_ERR(data->rst);
637637

638-
reset_control_deassert(data->rst);
638+
err = reset_control_deassert(data->rst);
639+
if (err)
640+
return dev_err_probe(dev, err, "failed to deassert resets\n");
639641

640642
err = devm_add_action_or_reset(dev, dw8250_reset_control_assert, data->rst);
641643
if (err)

0 commit comments

Comments
 (0)