mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-19 02:08:16 +07:00
serial-uartlite: Move the uart register
Move the uart register. This fixes the error path where the clock disable is missed out. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
275d924b4b
commit
f33cf77661
@ -763,6 +763,15 @@ static int ulite_probe(struct platform_device *pdev)
|
||||
if (prop)
|
||||
id = be32_to_cpup(prop);
|
||||
#endif
|
||||
if (!ulite_uart_driver.state) {
|
||||
dev_dbg(&pdev->dev, "uartlite: calling uart_register_driver()\n");
|
||||
ret = uart_register_driver(&ulite_uart_driver);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Failed to register driver\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
pdata = devm_kzalloc(&pdev->dev, sizeof(struct uartlite_data),
|
||||
GFP_KERNEL);
|
||||
if (!pdata)
|
||||
@ -794,15 +803,6 @@ static int ulite_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!ulite_uart_driver.state) {
|
||||
dev_dbg(&pdev->dev, "uartlite: calling uart_register_driver()\n");
|
||||
ret = uart_register_driver(&ulite_uart_driver);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "Failed to register driver\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = ulite_assign(&pdev->dev, id, res->start, irq, pdata);
|
||||
|
||||
clk_disable(pdata->clk);
|
||||
|
Loading…
Reference in New Issue
Block a user