Thread (15 messages) 15 messages, 6 authors, 2008-06-30

Re: [PATCH 2/6] MPC5121 clock driver

From: Stephen Rothwell <hidden>
Date: 2008-06-21 04:39:22

Hi John,

On Fri, 20 Jun 2008 10:58:35 -0600 John Rigby [off-list ref] wrote:
+struct module;
Since you include linux/module.h, you don't need this.
+static unsigned long devtree_getfreq(char *nodetype, char *clockname)
+{
+	struct device_node *node;
+	const unsigned int *fp;
+	unsigned int val = 0;
+
+	node = of_find_node_by_type(NULL, "soc");
+	if (node) {
+		fp = of_get_property(node, clockname, NULL);
+		if (fp)
+			val = of_read_ulong(fp, 1);
+	}
+	return val;
You leak a reference to the node here. Also every call has nodetype set to
"soc" and you don't use nodetype anyway.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

Attachments

  • (unnamed) [application/pgp-signature] 197 bytes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help