Thread (2 messages) 2 messages, 2 authors, 2011-07-30

Re: [PATCH v2 6/7] i2c: pxa: support i2c controller from DT

From: Mitch Bradley <hidden>
Date: 2011-07-30 14:29:50
Also in: linux-arm-kernel

Possibly related (same subject, not in this thread)

On 7/29/2011 6:55 AM, Russell King - ARM Linux wrote:
On Fri, Jul 29, 2011 at 10:52:22AM -0600, Grant Likely wrote:
quoted
On Thu, Jul 28, 2011 at 02:41:32PM +0800, Haojian Zhuang wrote:
quoted
-	/*
-	 * If "dev->id" is negative we consider it as zero.
-	 * The reason to do so is to avoid sysfs names that only make
-	 * sense when there are multiple adapters.
-	 */
-	i2c->adap.nr = dev->id;
-	snprintf(i2c->adap.name, sizeof(i2c->adap.name), "pxa_i2c-i2c.%u",
-		 i2c->adap.nr);

-	i2c->clk = clk_get(&dev->dev, NULL);
+	if (np) {
+		i2c->adap.nr = idx++;
Use this so that a bus number gets dynamically assigned:
		i2c->adap.nr = -1;
quoted
+		snprintf(i2c->adap.name, sizeof(i2c->adap.name),
+			"pxa2xx-i2c.%u", i2c->adap.nr);
+		i2c->clk = clk_get_sys(i2c->adap.name, NULL);
Missing i2c->adap.dev.of_node = dev->dev.of_node;
And here we go again.  Is it really the case that this DT stuff doesn't
have stable device names?
Device tree names are completely stable, based on hardware addresses 
that don't change from boot to boot.  Even for buses where access 
addresses are dynamically assigned, the device tree "reg property" 
address is based on a stable addressing form.  For example, PCI devices 
use the (stable) configuration address as the reg property and USB 
devices use the (stable) hub port number.

People's tendency to want to assign sequential small integers in Linux 
has nothing to do with the device tree.  I suspect that it's a carryover 
from the historical Unix major/minor device numbering model, but in any 
case, there's nothing unstable about the device tree naming model. 
Quite the opposite - stable naming was a fundamental criterion when I 
designed Open Firmware.
_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help