diff mbox series

[1/9] staging: media: atomisp: drop check for reentrant .s_stream()

Message ID f27c3713a56dc8dbe90c110349396fb70c6ee773.1696586632.git.hverkuil-cisco@xs4all.nl
State Accepted
Commit 6ccfe1e3971283fb5da0fef8c202f9998a5540fb
Headers show
Series media: fix smatch warnings | expand

Commit Message

Hans Verkuil Oct. 6, 2023, 10:08 a.m. UTC
The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Also fixes a smatch warning:

drivers/staging/media/atomisp/i2c/atomisp-gc0310.c:446 gc0310_s_stream() warn: missing error code 'ret'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
CC: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Hans de Goede Oct. 9, 2023, 2:48 p.m. UTC | #1
Hi,

On 10/6/23 12:08, Hans Verkuil wrote:
> The subdev .s_stream() operation shall not be called to start streaming
> on an already started subdev, or stop streaming on a stopped subdev.
> Remove the check that guards against that condition.
> 
> Also fixes a smatch warning:
> 
> drivers/staging/media/atomisp/i2c/atomisp-gc0310.c:446 gc0310_s_stream() warn: missing error code 'ret'
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> CC: Hans de Goede <hdegoede@redhat.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> index c438accb0472..58cddf11c9ab 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> @@ -441,11 +441,6 @@ static int gc0310_s_stream(struct v4l2_subdev *sd, int enable)
>  	dev_dbg(&client->dev, "%s S enable=%d\n", __func__, enable);
>  	mutex_lock(&dev->input_lock);
>  
> -	if (dev->is_streaming == enable) {
> -		dev_warn(&client->dev, "stream already %s\n", enable ? "started" : "stopped");
> -		goto error_unlock;
> -	}
> -
>  	if (enable) {
>  		ret = pm_runtime_get_sync(&client->dev);
>  		if (ret < 0)
> @@ -497,7 +492,6 @@ static int gc0310_s_stream(struct v4l2_subdev *sd, int enable)
>  error_power_down:
>  	pm_runtime_put(&client->dev);
>  	dev->is_streaming = false;
> -error_unlock:
>  	mutex_unlock(&dev->input_lock);
>  	return ret;
>  }
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
index c438accb0472..58cddf11c9ab 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
@@ -441,11 +441,6 @@  static int gc0310_s_stream(struct v4l2_subdev *sd, int enable)
 	dev_dbg(&client->dev, "%s S enable=%d\n", __func__, enable);
 	mutex_lock(&dev->input_lock);
 
-	if (dev->is_streaming == enable) {
-		dev_warn(&client->dev, "stream already %s\n", enable ? "started" : "stopped");
-		goto error_unlock;
-	}
-
 	if (enable) {
 		ret = pm_runtime_get_sync(&client->dev);
 		if (ret < 0)
@@ -497,7 +492,6 @@  static int gc0310_s_stream(struct v4l2_subdev *sd, int enable)
 error_power_down:
 	pm_runtime_put(&client->dev);
 	dev->is_streaming = false;
-error_unlock:
 	mutex_unlock(&dev->input_lock);
 	return ret;
 }