struct omap_uart_port_info *pdata = up->dev->platform_data;
if (!pdata || !pdata->get_context_loss_count)
- return 0;
+ return -EINVAL;
return pdata->get_context_loss_count(up->dev);
}
platform_set_drvdata(pdev, up);
pm_runtime_enable(&pdev->dev);
+ if (omap_up_info->autosuspend_timeout == 0)
+ omap_up_info->autosuspend_timeout = -1;
+ device_init_wakeup(up->dev, true);
pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_set_autosuspend_delay(&pdev->dev,
omap_up_info->autosuspend_timeout);
static int serial_omap_runtime_suspend(struct device *dev)
{
struct uart_omap_port *up = dev_get_drvdata(dev);
- struct omap_uart_port_info *pdata = dev->platform_data;
if (!up)
return -EINVAL;
uart_console(&up->port))
return -EBUSY;
- if (!pdata)
- return 0;
-
up->context_loss_cnt = serial_omap_get_context_loss_count(up);
if (device_may_wakeup(dev)) {
int loss_cnt = serial_omap_get_context_loss_count(up);
if (loss_cnt < 0) {
- dev_err(dev, "serial_omap_get_context_loss_count failed : %d\n",
+ dev_dbg(dev, "serial_omap_get_context_loss_count failed : %d\n",
loss_cnt);
serial_omap_restore_context(up);
} else if (up->context_loss_cnt != loss_cnt) {