Skip to content

Commit 07e5d4f

Browse files
committed
Revert "serial-uartlite: Add runtime support"
This reverts commit 0379b11. 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 5042ffb commit 07e5d4f

File tree

1 file changed

+9
-43
lines changed

1 file changed

+9
-43
lines changed

drivers/tty/serial/uartlite.c

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <linux/of_device.h>
2323
#include <linux/of_platform.h>
2424
#include <linux/clk.h>
25-
#include <linux/pm_runtime.h>
2625

2726
#define ULITE_NAME "ttyUL"
2827
#define ULITE_MAJOR 204
@@ -55,7 +54,6 @@
5554
#define ULITE_CONTROL_RST_TX 0x01
5655
#define ULITE_CONTROL_RST_RX 0x02
5756
#define ULITE_CONTROL_IE 0x10
58-
#define UART_AUTOSUSPEND_TIMEOUT 3000
5957

6058
/* Static pointer to console port */
6159
#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
@@ -393,12 +391,12 @@ static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)
393391
static void ulite_pm(struct uart_port *port, unsigned int state,
394392
unsigned int oldstate)
395393
{
396-
if (!state) {
397-
pm_runtime_get_sync(port->dev);
398-
} else {
399-
pm_runtime_mark_last_busy(port->dev);
400-
pm_runtime_put_autosuspend(port->dev);
401-
}
394+
struct uartlite_data *pdata = port->private_data;
395+
396+
if (!state)
397+
clk_enable(pdata->clk);
398+
else
399+
clk_disable(pdata->clk);
402400
}
403401

404402
#ifdef CONFIG_CONSOLE_POLL
@@ -745,32 +743,11 @@ static int __maybe_unused ulite_resume(struct device *dev)
745743
return 0;
746744
}
747745

748-
static int __maybe_unused ulite_runtime_suspend(struct device *dev)
749-
{
750-
struct uart_port *port = dev_get_drvdata(dev);
751-
struct uartlite_data *pdata = port->private_data;
752-
753-
clk_disable(pdata->clk);
754-
return 0;
755-
};
756-
757-
static int __maybe_unused ulite_runtime_resume(struct device *dev)
758-
{
759-
struct uart_port *port = dev_get_drvdata(dev);
760-
struct uartlite_data *pdata = port->private_data;
761-
762-
clk_enable(pdata->clk);
763-
return 0;
764-
}
765746
/* ---------------------------------------------------------------------
766747
* Platform bus binding
767748
*/
768749

769-
static const struct dev_pm_ops ulite_pm_ops = {
770-
SET_SYSTEM_SLEEP_PM_OPS(ulite_suspend, ulite_resume)
771-
SET_RUNTIME_PM_OPS(ulite_runtime_suspend,
772-
ulite_runtime_resume, NULL)
773-
};
750+
static SIMPLE_DEV_PM_OPS(ulite_pm_ops, ulite_suspend, ulite_resume);
774751

775752
#if defined(CONFIG_OF)
776753
/* Match table for of_platform binding */
@@ -843,15 +820,9 @@ static int ulite_probe(struct platform_device *pdev)
843820
return ret;
844821
}
845822

846-
pm_runtime_use_autosuspend(&pdev->dev);
847-
pm_runtime_set_autosuspend_delay(&pdev->dev, UART_AUTOSUSPEND_TIMEOUT);
848-
pm_runtime_set_active(&pdev->dev);
849-
pm_runtime_enable(&pdev->dev);
850-
851823
ret = ulite_assign(&pdev->dev, id, res->start, irq, pdata);
852824

853-
pm_runtime_mark_last_busy(&pdev->dev);
854-
pm_runtime_put_autosuspend(&pdev->dev);
825+
clk_disable(pdata->clk);
855826

856827
return ret;
857828
}
@@ -860,14 +831,9 @@ static int ulite_remove(struct platform_device *pdev)
860831
{
861832
struct uart_port *port = dev_get_drvdata(&pdev->dev);
862833
struct uartlite_data *pdata = port->private_data;
863-
int rc;
864834

865835
clk_disable_unprepare(pdata->clk);
866-
rc = ulite_release(&pdev->dev);
867-
pm_runtime_disable(&pdev->dev);
868-
pm_runtime_set_suspended(&pdev->dev);
869-
pm_runtime_dont_use_autosuspend(&pdev->dev);
870-
return rc;
836+
return ulite_release(&pdev->dev);
871837
}
872838

873839
/* work with hotplug and coldplug */

0 commit comments

Comments
 (0)