Thread (1 message) 1 message, 1 author, 2012-08-13

Re: [PATCH v2 2/2] powerpc/mpic: add global timer support

From: Scott Wood <hidden>
Date: 2012-08-13 16:50:42
Also in: linux-devicetree

On 08/13/2012 01:17 AM, Li Yang-R58472 wrote:
quoted
-----Original Message-----
From: Wang Dongsheng-B40534
Sent: Monday, August 13, 2012 1:54 PM
To: Wood Scott-B07421
Cc: benh@kernel.crashing.org; paulus@samba.org; linuxppc-
dev@lists.ozlabs.org; Gala Kumar-B11780; Li Yang-R58472
Subject: RE: [PATCH v2 2/2] powerpc/mpic: add global timer support


quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Saturday, August 11, 2012 3:40 AM
To: Wang Dongsheng-B40534
Cc: benh@kernel.crashing.org; paulus@samba.org; linuxppc-
dev@lists.ozlabs.org; Gala Kumar-B11780; Li Yang-R58472
Subject: Re: [PATCH v2 2/2] powerpc/mpic: add global timer support

On 08/10/2012 12:54 AM, Dongsheng.wang@freescale.com wrote:
quoted
+static const struct of_device_id mpic_timer_ids[] = {
+	{ .compatible = "open-pic,global-timer", },
+	{ .compatible = "fsl,global-timer", },
+	{},
+};
+
+static int __init mpic_timer_init(void) {
+	struct device_node *np = NULL;
+
+	for_each_node_by_type(np, "open-pic")
+		if (of_match_node(mpic_timer_ids, np))
+			group_init(np);
+
+	if (list_empty(&group_list))
+		return -ENODEV;
+
+	return 0;
+}
+arch_initcall(mpic_timer_init);
Oh, and don't probe by device_type.
Actually it does match the compatible.  The device_type is just to
speed up the search.  I don't think it's a problem unless the device
type is not mandatory any more for defined types.
Doesn't matter (and I doubt it provides any significant speed up
compared to a search by compatible, and in any case this is not
performance critical).  device_type is deprecated outside certain
specific legacy uses.  Get rid of it.

-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