linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: 8250_bcm2835aux: return PTR_ERR when fail to acquire clk
@ 2022-10-23  6:50 Zeng Heng
  2022-11-03  2:51 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Zeng Heng @ 2022-10-23  6:50 UTC (permalink / raw)
  To: jirislaby, f.fainelli, sbranden, l.sanfilippo, guomengqi3, rjui,
	ilpo.jarvinen, zengheng4, bcm-kernel-feedback-list, gregkh,
	athierry
  Cc: linux-arm-kernel, linux-rpi-kernel, liwei391, linux-kernel, linux-serial

Add error handling process when fail to acquire clk by
`devm_clk_get_optional`.

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
 drivers/tty/serial/8250/8250_bcm2835aux.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
index 15a2387a5b25..1c623e93232c 100644
--- a/drivers/tty/serial/8250/8250_bcm2835aux.c
+++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
@@ -119,6 +119,8 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
 
 	/* get the clock - this also enables the HW */
 	data->clk = devm_clk_get_optional(&pdev->dev, NULL);
+	if (IS_ERR(data->clk))
+		return PTR_ERR(data->clk);
 
 	/* get the interrupt */
 	ret = platform_get_irq(pdev, 0);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial: 8250_bcm2835aux: return PTR_ERR when fail to acquire clk
  2022-10-23  6:50 [PATCH] serial: 8250_bcm2835aux: return PTR_ERR when fail to acquire clk Zeng Heng
@ 2022-11-03  2:51 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-11-03  2:51 UTC (permalink / raw)
  To: Zeng Heng
  Cc: jirislaby, f.fainelli, sbranden, l.sanfilippo, guomengqi3, rjui,
	ilpo.jarvinen, bcm-kernel-feedback-list, athierry,
	linux-arm-kernel, linux-rpi-kernel, liwei391, linux-kernel,
	linux-serial

On Sun, Oct 23, 2022 at 02:50:53PM +0800, Zeng Heng wrote:
> Add error handling process when fail to acquire clk by
> `devm_clk_get_optional`.
> 
> Signed-off-by: Zeng Heng <zengheng4@huawei.com>
> ---
>  drivers/tty/serial/8250/8250_bcm2835aux.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
> index 15a2387a5b25..1c623e93232c 100644
> --- a/drivers/tty/serial/8250/8250_bcm2835aux.c
> +++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
> @@ -119,6 +119,8 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
>  
>  	/* get the clock - this also enables the HW */
>  	data->clk = devm_clk_get_optional(&pdev->dev, NULL);
> +	if (IS_ERR(data->clk))
> +		return PTR_ERR(data->clk);

How was this tested to verify that it works properly?

thanks,

greg k-h

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-03  2:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-23  6:50 [PATCH] serial: 8250_bcm2835aux: return PTR_ERR when fail to acquire clk Zeng Heng
2022-11-03  2:51 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).