]> git.baikalelectronics.ru Git - kernel.git/commitdiff
tty: serial: atmel: remove enable/disable clock due to atmel_console_setup()
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Thu, 16 Jun 2022 14:00:23 +0000 (17:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 12:39:51 +0000 (14:39 +0200)
There is no need for clk_prepare_enable() at the beginning of
atmel_console_setup() and clk_disable_unprepare() at the end of
atmel_console_setup() as the clock is already enabled when calling
atmel_console_setup() and its disablement is done at the end
of probe.

Acked-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220616140024.2081238-4-claudiu.beznea@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/atmel_serial.c

index 4cec97fd72412948532b108377bf08f138270bf9..3a94c2bdda72fb7fc683bc97f25efc43534da233 100644 (file)
@@ -2617,7 +2617,6 @@ static void __init atmel_console_get_options(struct uart_port *port, int *baud,
 
 static int __init atmel_console_setup(struct console *co, char *options)
 {
-       int ret;
        struct uart_port *port = &atmel_ports[co->index].uart;
        struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
        int baud = 115200;
@@ -2630,10 +2629,6 @@ static int __init atmel_console_setup(struct console *co, char *options)
                return -ENODEV;
        }
 
-       ret = clk_prepare_enable(atmel_ports[co->index].clk);
-       if (ret)
-               return ret;
-
        atmel_uart_writel(port, ATMEL_US_IDR, -1);
        atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);
        atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);
@@ -2914,17 +2909,6 @@ static int atmel_serial_probe(struct platform_device *pdev)
        if (ret)
                goto err_add_port;
 
-#ifdef CONFIG_SERIAL_ATMEL_CONSOLE
-       if (uart_console(&atmel_port->uart)
-                       && ATMEL_CONSOLE_DEVICE->flags & CON_ENABLED) {
-               /*
-                * The serial core enabled the clock for us, so undo
-                * the clk_prepare_enable() in atmel_console_setup()
-                */
-               clk_disable_unprepare(atmel_port->clk);
-       }
-#endif
-
        device_init_wakeup(&pdev->dev, 1);
        platform_set_drvdata(pdev, atmel_port);