Commit f33cf776 authored by Shubhrajyoti Datta's avatar Shubhrajyoti Datta Committed by Greg Kroah-Hartman

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: default avatarShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 275d924b
...@@ -763,6 +763,15 @@ static int ulite_probe(struct platform_device *pdev) ...@@ -763,6 +763,15 @@ static int ulite_probe(struct platform_device *pdev)
if (prop) if (prop)
id = be32_to_cpup(prop); id = be32_to_cpup(prop);
#endif #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), pdata = devm_kzalloc(&pdev->dev, sizeof(struct uartlite_data),
GFP_KERNEL); GFP_KERNEL);
if (!pdata) if (!pdata)
...@@ -794,15 +803,6 @@ static int ulite_probe(struct platform_device *pdev) ...@@ -794,15 +803,6 @@ static int ulite_probe(struct platform_device *pdev)
return ret; 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); ret = ulite_assign(&pdev->dev, id, res->start, irq, pdata);
clk_disable(pdata->clk); clk_disable(pdata->clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment