From: Scott Wood Date: Fri, 3 Apr 2009 20:48:44 +0000 (-0500) Subject: cpm_uart: Initialize port.dev before it's used. X-Git-Tag: upstream/snapshot3+hdmi~18988^2~49^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd86ef378412fc30282daf722a833f734e4e2236;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git cpm_uart: Initialize port.dev before it's used. Previously, this caused NULL to sometimes be passed as a device to the DMA code. With recent DMA changes, that now causes a BUG(). Signed-off-by: Scott Wood Signed-off-by: Kumar Gala --- diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 5c6ef51..4dd00be 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c @@ -1339,13 +1339,13 @@ static int __devinit cpm_uart_probe(struct of_device *ofdev, dev_set_drvdata(&ofdev->dev, pinfo); + /* initialize the device pointer for the port */ + pinfo->port.dev = &ofdev->dev; + ret = cpm_uart_init_port(ofdev->node, pinfo); if (ret) return ret; - /* initialize the device pointer for the port */ - pinfo->port.dev = &ofdev->dev; - return uart_add_one_port(&cpm_reg, &pinfo->port); }