diff mbox series

[V2] media: imx: imx8mq-mipi_csi2: Remove unneeded code

Message ID 20220128170722.1624767-1-usama.anjum@collabora.com (mailing list archive)
State New, archived
Headers show
Series [V2] media: imx: imx8mq-mipi_csi2: Remove unneeded code | expand

Commit Message

Muhammad Usama Anjum Jan. 28, 2022, 5:07 p.m. UTC
ret is constant in imx8mq_mipi_csi_pm_suspend(). This function cannot
return error. Remove the return variable. Simplify other functions which
are using this function.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
Changes in V2:
Removed fixes tag
---
 drivers/staging/media/imx/imx8mq-mipi-csi2.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

Comments

Fabio Estevam Jan. 29, 2022, 6:54 p.m. UTC | #1
On Fri, Jan 28, 2022 at 2:07 PM Muhammad Usama Anjum
<usama.anjum@collabora.com> wrote:
>
> ret is constant in imx8mq_mipi_csi_pm_suspend(). This function cannot
> return error. Remove the return variable. Simplify other functions which
> are using this function.
>
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
> Changes in V2:
> Removed fixes tag

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Muhammad Usama Anjum Feb. 18, 2022, 11:08 a.m. UTC | #2
Reminder.

On 1/28/22 10:07 PM, Muhammad Usama Anjum wrote:
> ret is constant in imx8mq_mipi_csi_pm_suspend(). This function cannot
> return error. Remove the return variable. Simplify other functions which
> are using this function.
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
> Changes in V2:
> Removed fixes tag
> ---
>  drivers/staging/media/imx/imx8mq-mipi-csi2.c | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
> index 3b9fa75efac6b..c992b845e63d1 100644
> --- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
> +++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
> @@ -693,11 +693,10 @@ static int imx8mq_mipi_csi_async_register(struct csi_state *state)
>   * Suspend/resume
>   */
>  
> -static int imx8mq_mipi_csi_pm_suspend(struct device *dev)
> +static void imx8mq_mipi_csi_pm_suspend(struct device *dev)
>  {
>  	struct v4l2_subdev *sd = dev_get_drvdata(dev);
>  	struct csi_state *state = mipi_sd_to_csi2_state(sd);
> -	int ret = 0;
>  
>  	mutex_lock(&state->lock);
>  
> @@ -708,8 +707,6 @@ static int imx8mq_mipi_csi_pm_suspend(struct device *dev)
>  	}
>  
>  	mutex_unlock(&state->lock);
> -
> -	return ret ? -EAGAIN : 0;
>  }
>  
>  static int imx8mq_mipi_csi_pm_resume(struct device *dev)
> @@ -742,15 +739,12 @@ static int __maybe_unused imx8mq_mipi_csi_suspend(struct device *dev)
>  {
>  	struct v4l2_subdev *sd = dev_get_drvdata(dev);
>  	struct csi_state *state = mipi_sd_to_csi2_state(sd);
> -	int ret;
>  
> -	ret = imx8mq_mipi_csi_pm_suspend(dev);
> -	if (ret)
> -		return ret;
> +	imx8mq_mipi_csi_pm_suspend(dev);
>  
>  	state->state |= ST_SUSPENDED;
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static int __maybe_unused imx8mq_mipi_csi_resume(struct device *dev)
> @@ -770,9 +764,7 @@ static int __maybe_unused imx8mq_mipi_csi_runtime_suspend(struct device *dev)
>  	struct csi_state *state = mipi_sd_to_csi2_state(sd);
>  	int ret;
>  
> -	ret = imx8mq_mipi_csi_pm_suspend(dev);
> -	if (ret)
> -		return ret;
> +	imx8mq_mipi_csi_pm_suspend(dev);
>  
>  	ret = icc_set_bw(state->icc_path, 0, 0);
>  	if (ret)
Muhammad Usama Anjum Feb. 25, 2022, 5:41 p.m. UTC | #3
From:
https://patchwork.linuxtv.org/project/linux-media/patch/20220128170722.1624767-1-usama.anjum@collabora.com/

State	Under Review
Delegated to:	Hans Verkuil

On 2/18/22 4:08 PM, Muhammad Usama Anjum wrote:
> Reminder.
> 
> On 1/28/22 10:07 PM, Muhammad Usama Anjum wrote:
>> ret is constant in imx8mq_mipi_csi_pm_suspend(). This function cannot
>> return error. Remove the return variable. Simplify other functions which
>> are using this function.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
>> ---
>> Changes in V2:
>> Removed fixes tag
>> ---
>>  drivers/staging/media/imx/imx8mq-mipi-csi2.c | 16 ++++------------
>>  1 file changed, 4 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
>> index 3b9fa75efac6b..c992b845e63d1 100644
>> --- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
>> +++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
>> @@ -693,11 +693,10 @@ static int imx8mq_mipi_csi_async_register(struct csi_state *state)
>>   * Suspend/resume
>>   */
>>  
>> -static int imx8mq_mipi_csi_pm_suspend(struct device *dev)
>> +static void imx8mq_mipi_csi_pm_suspend(struct device *dev)
>>  {
>>  	struct v4l2_subdev *sd = dev_get_drvdata(dev);
>>  	struct csi_state *state = mipi_sd_to_csi2_state(sd);
>> -	int ret = 0;
>>  
>>  	mutex_lock(&state->lock);
>>  
>> @@ -708,8 +707,6 @@ static int imx8mq_mipi_csi_pm_suspend(struct device *dev)
>>  	}
>>  
>>  	mutex_unlock(&state->lock);
>> -
>> -	return ret ? -EAGAIN : 0;
>>  }
>>  
>>  static int imx8mq_mipi_csi_pm_resume(struct device *dev)
>> @@ -742,15 +739,12 @@ static int __maybe_unused imx8mq_mipi_csi_suspend(struct device *dev)
>>  {
>>  	struct v4l2_subdev *sd = dev_get_drvdata(dev);
>>  	struct csi_state *state = mipi_sd_to_csi2_state(sd);
>> -	int ret;
>>  
>> -	ret = imx8mq_mipi_csi_pm_suspend(dev);
>> -	if (ret)
>> -		return ret;
>> +	imx8mq_mipi_csi_pm_suspend(dev);
>>  
>>  	state->state |= ST_SUSPENDED;
>>  
>> -	return ret;
>> +	return 0;
>>  }
>>  
>>  static int __maybe_unused imx8mq_mipi_csi_resume(struct device *dev)
>> @@ -770,9 +764,7 @@ static int __maybe_unused imx8mq_mipi_csi_runtime_suspend(struct device *dev)
>>  	struct csi_state *state = mipi_sd_to_csi2_state(sd);
>>  	int ret;
>>  
>> -	ret = imx8mq_mipi_csi_pm_suspend(dev);
>> -	if (ret)
>> -		return ret;
>> +	imx8mq_mipi_csi_pm_suspend(dev);
>>  
>>  	ret = icc_set_bw(state->icc_path, 0, 0);
>>  	if (ret)
diff mbox series

Patch

diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
index 3b9fa75efac6b..c992b845e63d1 100644
--- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
+++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
@@ -693,11 +693,10 @@  static int imx8mq_mipi_csi_async_register(struct csi_state *state)
  * Suspend/resume
  */
 
-static int imx8mq_mipi_csi_pm_suspend(struct device *dev)
+static void imx8mq_mipi_csi_pm_suspend(struct device *dev)
 {
 	struct v4l2_subdev *sd = dev_get_drvdata(dev);
 	struct csi_state *state = mipi_sd_to_csi2_state(sd);
-	int ret = 0;
 
 	mutex_lock(&state->lock);
 
@@ -708,8 +707,6 @@  static int imx8mq_mipi_csi_pm_suspend(struct device *dev)
 	}
 
 	mutex_unlock(&state->lock);
-
-	return ret ? -EAGAIN : 0;
 }
 
 static int imx8mq_mipi_csi_pm_resume(struct device *dev)
@@ -742,15 +739,12 @@  static int __maybe_unused imx8mq_mipi_csi_suspend(struct device *dev)
 {
 	struct v4l2_subdev *sd = dev_get_drvdata(dev);
 	struct csi_state *state = mipi_sd_to_csi2_state(sd);
-	int ret;
 
-	ret = imx8mq_mipi_csi_pm_suspend(dev);
-	if (ret)
-		return ret;
+	imx8mq_mipi_csi_pm_suspend(dev);
 
 	state->state |= ST_SUSPENDED;
 
-	return ret;
+	return 0;
 }
 
 static int __maybe_unused imx8mq_mipi_csi_resume(struct device *dev)
@@ -770,9 +764,7 @@  static int __maybe_unused imx8mq_mipi_csi_runtime_suspend(struct device *dev)
 	struct csi_state *state = mipi_sd_to_csi2_state(sd);
 	int ret;
 
-	ret = imx8mq_mipi_csi_pm_suspend(dev);
-	if (ret)
-		return ret;
+	imx8mq_mipi_csi_pm_suspend(dev);
 
 	ret = icc_set_bw(state->icc_path, 0, 0);
 	if (ret)