Skip to content

Commit 5d8508a

Browse files
committed
Revert "serial-uartlite: Do not use static struct uart_driver out of probe()"
This reverts commit 3b209d2. As Johan says, this driver needs a lot more work and these changes are only going in the wrong direction: https://lkml.kernel.org/r/20190523091839.GC568@localhost Reported-by: Johan Hovold <[email protected]> Cc: Shubhrajyoti Datta <[email protected]> Cc: Michal Simek <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 07e5d4f commit 5d8508a

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

drivers/tty/serial/uartlite.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ static struct uart_port *console_port;
6363
struct uartlite_data {
6464
const struct uartlite_reg_ops *reg_ops;
6565
struct clk *clk;
66-
struct uart_driver *ulite_uart_driver;
6766
};
6867

6968
struct uartlite_reg_ops {
@@ -695,9 +694,7 @@ static int ulite_release(struct device *dev)
695694
int rc = 0;
696695

697696
if (port) {
698-
struct uartlite_data *pdata = port->private_data;
699-
700-
rc = uart_remove_one_port(pdata->ulite_uart_driver, port);
697+
rc = uart_remove_one_port(&ulite_uart_driver, port);
701698
dev_set_drvdata(dev, NULL);
702699
port->mapbase = 0;
703700
}
@@ -715,11 +712,8 @@ static int __maybe_unused ulite_suspend(struct device *dev)
715712
{
716713
struct uart_port *port = dev_get_drvdata(dev);
717714

718-
if (port) {
719-
struct uartlite_data *pdata = port->private_data;
720-
721-
uart_suspend_port(pdata->ulite_uart_driver, port);
722-
}
715+
if (port)
716+
uart_suspend_port(&ulite_uart_driver, port);
723717

724718
return 0;
725719
}
@@ -734,11 +728,8 @@ static int __maybe_unused ulite_resume(struct device *dev)
734728
{
735729
struct uart_port *port = dev_get_drvdata(dev);
736730

737-
if (port) {
738-
struct uartlite_data *pdata = port->private_data;
739-
740-
uart_resume_port(pdata->ulite_uart_driver, port);
741-
}
731+
if (port)
732+
uart_resume_port(&ulite_uart_driver, port);
742733

743734
return 0;
744735
}
@@ -813,7 +804,6 @@ static int ulite_probe(struct platform_device *pdev)
813804
pdata->clk = NULL;
814805
}
815806

816-
pdata->ulite_uart_driver = &ulite_uart_driver;
817807
ret = clk_prepare_enable(pdata->clk);
818808
if (ret) {
819809
dev_err(&pdev->dev, "Failed to prepare clock\n");

0 commit comments

Comments
 (0)