From: Vikram Pandita Date: Mon, 8 Jul 2013 07:25:43 +0000 (+0300) Subject: serial: omap: Initialize platform_data X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a0a490f9df2bf7e077054c78221c6b5301681de6;p=openwrt%2Fstaging%2Fblogic.git serial: omap: Initialize platform_data Otherwise serial driver would crash accessing platform_data that was not initialized in functions like: serial_omap_pm(...) ... if (!state && pdata->enable_wakeup) ^^^^^^^ ... Signed-off-by: Vikram Pandita Signed-off-by: Alexander Savchenko Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 9b6fc54967f2..72bb690829af 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1414,8 +1414,10 @@ static int serial_omap_probe(struct platform_device *pdev) struct omap_uart_port_info *omap_up_info = pdev->dev.platform_data; int ret; - if (pdev->dev.of_node) + if (pdev->dev.of_node) { omap_up_info = of_get_uart_port_info(&pdev->dev); + pdev->dev.platform_data = omap_up_info; + } mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) {