summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/uartlite.c
diff options
context:
space:
mode:
authorShubhrajyoti Datta2018-10-16 12:18:00 +0200
committerGreg Kroah-Hartman2018-11-09 17:45:07 +0100
commitf33cf776617ba3b0f738cd70c31e0f62ea777a8d (patch)
tree65b12ec7a294dadd850b6b34672e840fef4d5f6d /drivers/tty/serial/uartlite.c
parentdt-bindings: serial: lantiq: Add optional properties for CCF (diff)
downloadkernel-qcow2-linux-f33cf776617ba3b0f738cd70c31e0f62ea777a8d.tar.gz
kernel-qcow2-linux-f33cf776617ba3b0f738cd70c31e0f62ea777a8d.tar.xz
kernel-qcow2-linux-f33cf776617ba3b0f738cd70c31e0f62ea777a8d.zip
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>
Diffstat (limited to 'drivers/tty/serial/uartlite.c')
-rw-r--r--drivers/tty/serial/uartlite.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index f0344adc86db..77bc9d0cb8bf 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -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);