Skip to contentSkip to conversation

serial: sh-sci: Allow AUXDATA DMAC parameters

PATCH New Magnus Damm 1 participant 1 message Jun 25, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 serial: sh-sci: Allow AUXDATA DMAC parameters

From: Magnus Damm <[email protected]>

Allow passing platform data also in the case of DT. With this in place it is possible to use AUXDATA together with platform data to specify DMA channel configuration.

---

 drivers/tty/serial/sh-sci.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/tty/serial/sh-sci.c +6 -2
@@ -2470,9 +2470,13 @@ sci_parse_dt(struct platform_device *pde
 
 	info = match->data;
 
-	p = devm_kzalloc(&pdev->dev, sizeof(struct plat_sci_port), GFP_KERNEL);
+	if (pdev->dev.platform_data)
+		p = pdev->dev.platform_data;
+	else
+		p = devm_kzalloc(&pdev->dev, sizeof(struct plat_sci_port),
+				 GFP_KERNEL);
 	if (!p) {
-		dev_err(&pdev->dev, "failed to allocate DT config data\n");
+		dev_err(&pdev->dev, "failed to get DT config data\n");
 		return NULL;
 	}