diff mbox series

[v1] tty: serial: samsung:Simplify with dev_err_probe()

Message ID 20240830033251.232992-1-yujiaoliang@vivo.com
State New
Headers show
Series [v1] tty: serial: samsung:Simplify with dev_err_probe() | expand

Commit Message

Yu Jiaoliang Aug. 30, 2024, 3:32 a.m. UTC
Error handling in probe() can be a bit simpler with dev_err_probe().

Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com>
---
 drivers/tty/serial/samsung_tty.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Krzysztof Kozlowski Aug. 30, 2024, 8 a.m. UTC | #1
On 30/08/2024 05:32, Yu Jiaoliang wrote:
> Error handling in probe() can be a bit simpler with dev_err_probe().
> 
> Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com>
> ---
>  drivers/tty/serial/samsung_tty.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> index c4f2ac9518aa..3550177010ad 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -1225,10 +1225,8 @@ static int s3c64xx_serial_startup(struct uart_port *port)
>  
>  	ret = request_irq(port->irq, s3c64xx_serial_handle_irq, IRQF_SHARED,
>  			  s3c24xx_serial_portname(port), ourport);
> -	if (ret) {
> -		dev_err(port->dev, "cannot get irq %d\n", port->irq);
> -		return ret;
> -	}
> +	if (ret)
> +		return dev_err_probe(port->dev, port->irq, "cannot get irq\n");

I don't think you really thought this through. First, why changing only
one place, but leaving the rest intact? Are you going to send one patch
per one dev_err_probe()?

Second, that's not even probe path.

NAK

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index c4f2ac9518aa..3550177010ad 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -1225,10 +1225,8 @@  static int s3c64xx_serial_startup(struct uart_port *port)
 
 	ret = request_irq(port->irq, s3c64xx_serial_handle_irq, IRQF_SHARED,
 			  s3c24xx_serial_portname(port), ourport);
-	if (ret) {
-		dev_err(port->dev, "cannot get irq %d\n", port->irq);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(port->dev, port->irq, "cannot get irq\n");
 
 	/* For compatibility with s3c24xx Soc's */
 	ourport->rx_enabled = 1;