diff mbox series

[-next] power: avs: qcom-cpr: simplify the return expression of cpr_disable()

Message ID 20200915032629.1772569-1-liushixin2@huawei.com (mailing list archive)
State Accepted, archived
Commit 3ffe2e7318ba705b8e0060d4696cafc75170e819
Headers show
Series [-next] power: avs: qcom-cpr: simplify the return expression of cpr_disable() | expand

Commit Message

Liu Shixin Sept. 15, 2020, 3:26 a.m. UTC
Simplify the return expression.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/power/avs/qcom-cpr.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Bjorn Andersson Sept. 15, 2020, 3:17 a.m. UTC | #1
On Mon 14 Sep 22:26 CDT 2020, Liu Shixin wrote:

> Simplify the return expression.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> ---
>  drivers/power/avs/qcom-cpr.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/power/avs/qcom-cpr.c b/drivers/power/avs/qcom-cpr.c
> index bd7c3e48b386..b24cc77d1889 100644
> --- a/drivers/power/avs/qcom-cpr.c
> +++ b/drivers/power/avs/qcom-cpr.c
> @@ -665,8 +665,6 @@ static int cpr_enable(struct cpr_drv *drv)
>  
>  static int cpr_disable(struct cpr_drv *drv)
>  {
> -	int ret;
> -
>  	mutex_lock(&drv->lock);
>  
>  	if (cpr_is_allowed(drv)) {
> @@ -676,11 +674,7 @@ static int cpr_disable(struct cpr_drv *drv)
>  
>  	mutex_unlock(&drv->lock);
>  
> -	ret = regulator_disable(drv->vdd_apc);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return regulator_disable(drv->vdd_apc);
>  }
>  
>  static int cpr_config(struct cpr_drv *drv)
> -- 
> 2.25.1
>
Kevin Hilman Sept. 18, 2020, 8:12 p.m. UTC | #2
Bjorn Andersson <bjorn.andersson@linaro.org> writes:

> On Mon 14 Sep 22:26 CDT 2020, Liu Shixin wrote:
>
>> Simplify the return expression.
>> 
>> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
>
> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Acked-by: Kevin Hilman <khilman@baylibre.com>

Rafael, please apply directly.
Rafael J. Wysocki Sept. 22, 2020, 4:07 p.m. UTC | #3
On Fri, Sep 18, 2020 at 10:12 PM Kevin Hilman <khilman@baylibre.com> wrote:
>
> Bjorn Andersson <bjorn.andersson@linaro.org> writes:
>
> > On Mon 14 Sep 22:26 CDT 2020, Liu Shixin wrote:
> >
> >> Simplify the return expression.
> >>
> >> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> >
> > Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>
> Acked-by: Kevin Hilman <khilman@baylibre.com>
>
> Rafael, please apply directly.

Applied as 5.10 material with minor edits in the subject, thanks!
diff mbox series

Patch

diff --git a/drivers/power/avs/qcom-cpr.c b/drivers/power/avs/qcom-cpr.c
index bd7c3e48b386..b24cc77d1889 100644
--- a/drivers/power/avs/qcom-cpr.c
+++ b/drivers/power/avs/qcom-cpr.c
@@ -665,8 +665,6 @@  static int cpr_enable(struct cpr_drv *drv)
 
 static int cpr_disable(struct cpr_drv *drv)
 {
-	int ret;
-
 	mutex_lock(&drv->lock);
 
 	if (cpr_is_allowed(drv)) {
@@ -676,11 +674,7 @@  static int cpr_disable(struct cpr_drv *drv)
 
 	mutex_unlock(&drv->lock);
 
-	ret = regulator_disable(drv->vdd_apc);
-	if (ret)
-		return ret;
-
-	return 0;
+	return regulator_disable(drv->vdd_apc);
 }
 
 static int cpr_config(struct cpr_drv *drv)