]> git.baikalelectronics.ru Git - kernel.git/commit
reset: fix shared reset triggered_count decrement on error
authorJerome Brunet <jbrunet@baylibre.com>
Wed, 15 Feb 2017 18:15:51 +0000 (19:15 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 17 Feb 2017 07:11:47 +0000 (08:11 +0100)
commit70bd85e4e7b97ad0a0624ccaffb509755f0228f4
tree93610a81eede4f90e8232122010f1a4241be4368
parent4184c0ec1ade2b73b58c41e1084d8b22fc53d09b
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: 5b1ad6010a1f ("reset: allow using reset_control_reset with shared reset")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/core.c