From: Andy Shevchenko Date: Fri, 21 Mar 2025 18:20:17 +0000 (+0200) Subject: serial: 8250_ni: Switch to use dev_err_probe() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=030df0ef7cec3232122626b642b5642cf5677fc0;p=users%2Fjedix%2Flinux-maple.git serial: 8250_ni: Switch to use dev_err_probe() Switch to use dev_err_probe() to simplify the error path and unify a message template. Signed-off-by: Andy Shevchenko Tested-by: Chaitanya Vadrevu Reviewed-by: Chaitanya Vadrevu Link: https://lore.kernel.org/r/20250321182119.454507-7-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/8250/8250_ni.c b/drivers/tty/serial/8250/8250_ni.c index 15bee1b7dc2a3..c66bfc56838e0 100644 --- a/drivers/tty/serial/8250/8250_ni.c +++ b/drivers/tty/serial/8250/8250_ni.c @@ -333,11 +333,8 @@ static int ni16550_probe(struct platform_device *pdev) uart.port.uartclk = clk_get_rate(data->clk); } - if (!uart.port.uartclk) { - dev_err(dev, "unable to determine clock frequency!\n"); - ret = -ENODEV; - goto err; - } + if (!uart.port.uartclk) + return dev_err_probe(dev, -ENODEV, "unable to determine clock frequency!\n"); prescaler = info->prescaler; device_property_read_u32(dev, "clock-prescaler", &prescaler); @@ -381,14 +378,11 @@ static int ni16550_probe(struct platform_device *pdev) ret = serial8250_register_8250_port(&uart); if (ret < 0) - goto err; + return ret; data->line = ret; platform_set_drvdata(pdev, data); return 0; - -err: - return ret; } static void ni16550_remove(struct platform_device *pdev)