mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 14:56:54 -04:00
media: rcar-vin: Remove superfluous suspended state
The VIN state of suspended is superfluous. The logic was that when the device were suspended and in a RUNNING state the state was set to SUSPENDED. And when resuming it checked if the state is SUSPENDED and if so started the device and changed it to RUNNING. This can be avoided by simply checking if the device is in a RUNNING state at both suspend and resume callbacks. Remove the unneeded complexity. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Tested-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
committed by
Hans Verkuil
parent
f2f0cd8925
commit
1dadd89b58
@@ -1085,8 +1085,6 @@ static int __maybe_unused rvin_suspend(struct device *dev)
|
||||
|
||||
rvin_stop_streaming(vin);
|
||||
|
||||
vin->state = SUSPENDED;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1094,7 +1092,7 @@ static int __maybe_unused rvin_resume(struct device *dev)
|
||||
{
|
||||
struct rvin_dev *vin = dev_get_drvdata(dev);
|
||||
|
||||
if (vin->state != SUSPENDED)
|
||||
if (vin->state != RUNNING)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
|
||||
@@ -67,14 +67,12 @@ enum rvin_isp_id {
|
||||
* @STARTING: Capture starting up
|
||||
* @RUNNING: Operation in progress have buffers
|
||||
* @STOPPING: Stopping operation
|
||||
* @SUSPENDED: Capture is suspended
|
||||
*/
|
||||
enum rvin_dma_state {
|
||||
STOPPED = 0,
|
||||
STARTING,
|
||||
RUNNING,
|
||||
STOPPING,
|
||||
SUSPENDED,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user