diff mbox series

[-next] drivers/tty/serial: Add missing clk_disable_unprepare()

Message ID 20220617025827.130497-1-guomengqi3@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] drivers/tty/serial: Add missing clk_disable_unprepare() | expand

Commit Message

guomengqi (A) June 17, 2022, 2:58 a.m. UTC
Add missing clk_disable_unprepare() when get clk rate fails.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Guo Mengqi <guomengqi3@huawei.com>
---
 drivers/tty/serial/8250/8250_bcm2835aux.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Greg Kroah-Hartman June 27, 2022, 12:06 p.m. UTC | #1
On Fri, Jun 17, 2022 at 10:58:27AM +0800, Guo Mengqi wrote:
> Add missing clk_disable_unprepare() when get clk rate fails.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>

How did the robot report it?

How was this tested?

You have read the documentation for how to correctly report problems
found and fixed by automated tools, right?  Please update the changelog
to include all of that information.

thanks,

greg k-h
Florian Fainelli July 12, 2022, 3:35 a.m. UTC | #2
On 6/16/2022 7:58 PM, 'Guo Mengqi' via BCM-KERNEL-FEEDBACK-LIST,PDL wrote:
> Add missing clk_disable_unprepare() when get clk rate fails.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Guo Mengqi <guomengqi3@huawei.com>

Looks about right, can we use the same prefix as the majority of other 
changes:

serial: 8250_bcm2835aux: Add missing clk_disable_unprepare()

and slap a:

Fixes: fcc446c8aa63 ("serial: 8250_bcm2835aux: Add ACPI support")

Thanks!

> ---
>   drivers/tty/serial/8250/8250_bcm2835aux.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
> index 2a1226a78a0c..21939bb44613 100644
> --- a/drivers/tty/serial/8250/8250_bcm2835aux.c
> +++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
> @@ -166,8 +166,10 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
>   	uartclk = clk_get_rate(data->clk);
>   	if (!uartclk) {
>   		ret = device_property_read_u32(&pdev->dev, "clock-frequency", &uartclk);
> -		if (ret)
> -			return dev_err_probe(&pdev->dev, ret, "could not get clk rate\n");
> +		if (ret) {
> +			dev_err_probe(&pdev->dev, ret, "could not get clk rate\n");
> +			goto dis_clk;
> +		}
>   	}
>   
>   	/* the HW-clock divider for bcm2835aux is 8,
guomengqi (A) July 13, 2022, 7:37 a.m. UTC | #3
Hi Florian,

Yes I found it's better to use title of same style. I did not pay 
attention to this.

I will send a new version of this patch.

Thank you!

在 2022/7/12 11:35, Florian Fainelli 写道:
>
>
> On 6/16/2022 7:58 PM, 'Guo Mengqi' via BCM-KERNEL-FEEDBACK-LIST,PDL 
> wrote:
>> Add missing clk_disable_unprepare() when get clk rate fails.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Guo Mengqi <guomengqi3@huawei.com>
>
> Looks about right, can we use the same prefix as the majority of other 
> changes:
>
> serial: 8250_bcm2835aux: Add missing clk_disable_unprepare()
>
> and slap a:
>
> Fixes: fcc446c8aa63 ("serial: 8250_bcm2835aux: Add ACPI support")
>
> Thanks!
>
>> ---
>>   drivers/tty/serial/8250/8250_bcm2835aux.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c 
>> b/drivers/tty/serial/8250/8250_bcm2835aux.c
>> index 2a1226a78a0c..21939bb44613 100644
>> --- a/drivers/tty/serial/8250/8250_bcm2835aux.c
>> +++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
>> @@ -166,8 +166,10 @@ static int bcm2835aux_serial_probe(struct 
>> platform_device *pdev)
>>       uartclk = clk_get_rate(data->clk);
>>       if (!uartclk) {
>>           ret = device_property_read_u32(&pdev->dev, 
>> "clock-frequency", &uartclk);
>> -        if (ret)
>> -            return dev_err_probe(&pdev->dev, ret, "could not get clk 
>> rate\n");
>> +        if (ret) {
>> +            dev_err_probe(&pdev->dev, ret, "could not get clk rate\n");
>> +            goto dis_clk;
>> +        }
>>       }
>>         /* the HW-clock divider for bcm2835aux is 8,
>
diff mbox series

Patch

diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
index 2a1226a78a0c..21939bb44613 100644
--- a/drivers/tty/serial/8250/8250_bcm2835aux.c
+++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
@@ -166,8 +166,10 @@  static int bcm2835aux_serial_probe(struct platform_device *pdev)
 	uartclk = clk_get_rate(data->clk);
 	if (!uartclk) {
 		ret = device_property_read_u32(&pdev->dev, "clock-frequency", &uartclk);
-		if (ret)
-			return dev_err_probe(&pdev->dev, ret, "could not get clk rate\n");
+		if (ret) {
+			dev_err_probe(&pdev->dev, ret, "could not get clk rate\n");
+			goto dis_clk;
+		}
 	}
 
 	/* the HW-clock divider for bcm2835aux is 8,