mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
serial: 8250_dw: handle reset control deassert error
[ Upstream commit daeb4037adf7d3349b4a1fb792f4bc9824686a4b ]
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: acbdad8dd1 ("serial: 8250_dw: simplify optional reset handling")
Cc: stable <stable@kernel.org>
Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com>
Link: https://patch.msgid.link/20251019095131.252848-1-a.shimko.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
71e98d9b72
commit
e04a335404
1 changed files with 3 additions and 1 deletions
|
|
@ -523,7 +523,9 @@ static int dw8250_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(data->rst))
|
||||
return PTR_ERR(data->rst);
|
||||
|
||||
reset_control_deassert(data->rst);
|
||||
err = reset_control_deassert(data->rst);
|
||||
if (err)
|
||||
return dev_err_probe(dev, err, "failed to deassert resets\n");
|
||||
|
||||
err = devm_add_action_or_reset(dev, dw8250_reset_control_assert, data->rst);
|
||||
if (err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue