mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
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 <andriy.shevchenko@linux.intel.com> Tested-by: Chaitanya Vadrevu <chaitanya.vadrevu@emerson.com> Reviewed-by: Chaitanya Vadrevu <chaitanya.vadrevu@emerson.com> Link: https://lore.kernel.org/r/20250321182119.454507-7-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2e4899740e
commit
030df0ef7c
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user