Commit e5a1dade authored by Jerome Brunet's avatar Jerome Brunet Committed by Philipp Zabel
Browse files

reset: fix shared reset triggered_count decrement on error

For a shared reset, when the reset is successful, the triggered_count is
incremented when trying to call the reset callback, so that another device
sharing the same reset line won't trigger it again. If the reset has not
been triggered successfully, the trigger_count should be decremented.

The code does the opposite, and decrements the trigger_count on success.
As a consequence, another device sharing the reset will be able to trigger
it again.

Fixed be removing negation in from of the error code of the reset function.

Fixes: 7da33a37

 ("reset: allow using reset_control_reset with shared reset")

Signed-off-by: default avatarJerome Brunet <>
Acked-by: default avatarMartin Blumenstingl <>
Signed-off-by: default avatarPhilipp Zabel <>
parent 7ce7d89f
......@@ -163,7 +163,7 @@ int reset_control_reset(struct reset_control *rstc)
ret = rstc->rcdev->ops->reset(rstc->rcdev, rstc->id);
if (rstc->shared && !ret)
if (rstc->shared && ret)
return ret;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment