diff mbox series

[v2,2/2] PM / devfreq: exynos-bus: Disable devfreq-event device when fails

Message ID 20191222174132.3701-2-tiny.windzz@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] PM / devfreq: rk3399_dmc: Disable devfreq-event device when fails | expand

Commit Message

Yangtao Li Dec. 22, 2019, 5:41 p.m. UTC
The exynos_bus_profile_init process may fail, but the devfreq event device
remains enabled. Call devfreq_event_disable_edev on the error return path.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
v2:
-change subject
-rename lable to err_edev
-add return value check
---
 drivers/devfreq/exynos-bus.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Chanwoo Choi Dec. 23, 2019, 12:47 a.m. UTC | #1
On 12/23/19 2:41 AM, Yangtao Li wrote:
> The exynos_bus_profile_init process may fail, but the devfreq event device
> remains enabled. Call devfreq_event_disable_edev on the error return path.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
> v2:
> -change subject
> -rename lable to err_edev
> -add return value check
> ---
>  drivers/devfreq/exynos-bus.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index 7f5917d59072..948e9340f91c 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -335,10 +335,17 @@ static int exynos_bus_profile_init(struct exynos_bus *bus,
>  	ret = exynos_bus_set_event(bus);
>  	if (ret < 0) {
>  		dev_err(dev, "failed to set event to devfreq-event devices\n");
> -		return ret;
> +		goto err_edev;
>  	}
>  
>  	return 0;
> +
> +err_edev:
> +	ret = exynos_bus_disable_edev(bus);
> +	if (ret < 0)
> +		dev_warn(dev, "failed to disable the devfreq-event devices\n");
> +
> +	return ret;
>  }
>  
>  static int exynos_bus_profile_init_passive(struct exynos_bus *bus,
> 

Applied it.
Chanwoo Choi Dec. 23, 2019, 12:50 a.m. UTC | #2
On 12/23/19 9:47 AM, Chanwoo Choi wrote:
> On 12/23/19 2:41 AM, Yangtao Li wrote:
>> The exynos_bus_profile_init process may fail, but the devfreq event device
>> remains enabled. Call devfreq_event_disable_edev on the error return path.
>>
>> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
>> ---
>> v2:
>> -change subject
>> -rename lable to err_edev
>> -add return value check
>> ---
>>  drivers/devfreq/exynos-bus.c | 9 ++++++++-
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
>> index 7f5917d59072..948e9340f91c 100644
>> --- a/drivers/devfreq/exynos-bus.c
>> +++ b/drivers/devfreq/exynos-bus.c
>> @@ -335,10 +335,17 @@ static int exynos_bus_profile_init(struct exynos_bus *bus,
>>  	ret = exynos_bus_set_event(bus);
>>  	if (ret < 0) {
>>  		dev_err(dev, "failed to set event to devfreq-event devices\n");
>> -		return ret;
>> +		goto err_edev;
>>  	}
>>  
>>  	return 0;
>> +
>> +err_edev:
>> +	ret = exynos_bus_disable_edev(bus);
>> +	if (ret < 0)
>> +		dev_warn(dev, "failed to disable the devfreq-event devices\n");
>> +
>> +	return ret;
>>  }
>>  
>>  static int exynos_bus_profile_init_passive(struct exynos_bus *bus,
>>
> 
> Applied it.
> 

I'm sorry. I applied the v3[1] patch instead of this.
[1] https://patchwork.kernel.org/patch/11307721/
diff mbox series

Patch

diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
index 7f5917d59072..948e9340f91c 100644
--- a/drivers/devfreq/exynos-bus.c
+++ b/drivers/devfreq/exynos-bus.c
@@ -335,10 +335,17 @@  static int exynos_bus_profile_init(struct exynos_bus *bus,
 	ret = exynos_bus_set_event(bus);
 	if (ret < 0) {
 		dev_err(dev, "failed to set event to devfreq-event devices\n");
-		return ret;
+		goto err_edev;
 	}
 
 	return 0;
+
+err_edev:
+	ret = exynos_bus_disable_edev(bus);
+	if (ret < 0)
+		dev_warn(dev, "failed to disable the devfreq-event devices\n");
+
+	return ret;
 }
 
 static int exynos_bus_profile_init_passive(struct exynos_bus *bus,