Thread (13 messages) 13 messages, 2 authors, 2016-10-28

Re: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

From: Scott Wood <oss@buserror.net>
Date: 2016-10-28 04:46:29
Also in: linux-arm-kernel, linux-clk, linux-i2c, linux-iommu, linux-mmc, linuxppc-dev, lkml, netdev

On Fri, 2016-10-28 at 11:32 +0800, Yangbo Lu wrote:
+	guts->regs = of_iomap(np, 0);
+	if (!guts->regs)
+		return -ENOMEM;
+
+	/* Register soc device */
+	machine = of_flat_dt_get_machine_name();
+	if (machine)
+		soc_dev_attr.machine = devm_kstrdup(dev, machine,
GFP_KERNEL);
+
+	svr = fsl_guts_get_svr();
+	soc_die = fsl_soc_die_match(svr, fsl_soc_die);
+	if (soc_die) {
+		soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL,
+						     "QorIQ %s", soc_die-
quoted
die);
+	} else {
+		soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL,
"QorIQ");
+	}
+	soc_dev_attr.soc_id = devm_kasprintf(dev, GFP_KERNEL,
+					     "svr:0x%08x", svr);
+	soc_dev_attr.revision = devm_kasprintf(dev, GFP_KERNEL, "%d.%d",
+					       SVR_MAJ(svr), SVR_MIN(svr));
+
+	soc_dev = soc_device_register(&soc_dev_attr);
+	if (IS_ERR(soc_dev))
+		return PTR_ERR(soc_dev);
ioremap leaks on this error path.  Use devm_ioremap_resource().

-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help