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, 21 Mar 2022 16:04:09 +0000 (16:04 +0000)
commit11fb509ec82bf7d0b87ec2e3f5724b51a62fbc9b
tree2a3bdaa2b736d7549f356797fafd81b9e6dfc018
parentc8051d40d2744ab37ad46463a23c151adc07e4f1
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