media: bcm2835-unicam: Return early from stop_streaming() if stopped
authorNaushir Patuck <naush@raspberrypi.com>
Wed, 2 Dec 2020 15:26:09 +0000 (15:26 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:07 +0000 (11:33 +0000)
commit96aa9a454f3a02910be958c3a78271aa438dae82
tree8308b9d47c7b298bd680b5d4896d3ed9c5a4a9db
parent8970be71ea26a88c986beaeefeacab8d0a086853
media: bcm2835-unicam: Return early from stop_streaming() if stopped

clk_disable_unprepare() is called unconditionally in stop_streaming().
This is incorrect in the cases where start_streaming() fails, and
unprepares all clocks as part of the failure cleanup. To avoid this,
ensure that clk_disable_unprepare() is only called in stop_streaming()
if the clocks are in a prepared state.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
drivers/media/platform/bcm2835/bcm2835-unicam.c