Skip to content

Commit 18a5f1a

Browse files
Artem Shimkobroonie
authored andcommitted
spi: dw-mmio: add error handling for reset_control_deassert()
Currently reset_control_deassert() is called without checking its return value. This can lead to silent failures when reset deassertion fails. Add proper error handling to: 1. Check the return value of reset_control_deassert() 2. Return the error to the caller 3. Provide meaningful error message using dev_err_probe() This ensures that reset-related failures are properly reported during probe and helps with debugging reset issues. Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com> Link: https://patch.msgid.link/20251007101134.1912895-1-a.shimko.dev@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent ee795e8 commit 18a5f1a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/spi/spi-dw-mmio.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
358358
if (IS_ERR(dwsmmio->rstc))
359359
return PTR_ERR(dwsmmio->rstc);
360360

361-
reset_control_deassert(dwsmmio->rstc);
361+
ret = reset_control_deassert(dwsmmio->rstc);
362+
if (ret)
363+
return dev_err_probe(&pdev->dev, ret, "Failed to deassert resets\n");
362364

363365
dws->bus_num = pdev->id;
364366

0 commit comments

Comments
 (0)