Skip to contentSkip to conversation

pxa2xx: Auto-assign name for i2c bus in i2c_init_bus.

PATCH Applied Vijay Kumar B 2 participants 2 messages Oct 13, 2016 – Oct 17, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pxa2xx: Auto-assign name for i2c bus in i2c_init_bus.

If a name is provided, the same name is assigned to both the I2C controllers. Leaving it NULL, causes names to be automatically assigned with an ID suffix, giving unique names to each controller. This helps us to uniquely identify each controller in the device tree, for example when adding an I2C device.

---
 hw/arm/pxa2xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/pxa2xx.c +1 -1
index 0241e07..9898287 100644
@@ -1505,7 +1505,7 @@ static void pxa2xx_i2c_initfn(Object *obj)
     PXA2xxI2CState *s = PXA2XX_I2C(obj);
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
 
-    s->bus = i2c_init_bus(dev, "i2c");
+    s->bus = i2c_init_bus(dev, NULL);
 
     memory_region_init_io(&s->iomem, obj, &pxa2xx_i2c_ops, s,
                           "pxa2xx-i2c", s->region_size);
Signature · 1 line
2.1.4
#1 lore raw
Quoted 17 lines · Vijay Kumar B

If a name is provided, the same name is assigned to both the I2C controllers. Leaving it NULL, causes names to be automatically assigned with an ID suffix, giving unique names to each controller. This helps us to uniquely identify each controller in the device tree, for example when adding an I2C device.

---
 hw/arm/pxa2xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/pxa2xx.c +0 -0
index 0241e07..9898287 100644

hw/arm/pxa2xx.c static void pxa2xx_i2c_initfn(Object *obj) · line 1511

Quoted 8 lines
hw/arm/pxa2xx.c +1 -1
@@ -1505,7 +1505,7 @@ static void pxa2xx_i2c_initfn(Object *obj)
     PXA2xxI2CState *s = PXA2XX_I2C(obj);
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
 
-    s->bus = i2c_init_bus(dev, "i2c");
+    s->bus = i2c_init_bus(dev, NULL);
 
     memory_region_init_io(&s->iomem, obj, &pxa2xx_i2c_ops, s,
                           "pxa2xx-i2c", s->region_size);

Applied to target-arm.next, thanks.

-- PMM