Skip to contentSkip to conversation

hw/i2c/npcm7xx_smbus: Simplify npcm7xx_smbus_init()

PATCH Applied Philippe Mathieu-Daudé 3 participants 3 messages Feb 28, 2021 – Mar 5, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/i2c/npcm7xx_smbus: Simplify npcm7xx_smbus_init()

The STATUS register will be reset to IDLE in
cnpcm7xx_smbus_enter_reset(), no need to preset
it in instance_init().

---
 hw/i2c/npcm7xx_smbus.c | 1 -
 1 file changed, 1 deletion(-)
hw/i2c/npcm7xx_smbus.c +0 -1
index 6b2f9e1aaad..e7e0ba66fe7 100644
@@ -1040,7 +1040,6 @@ static void npcm7xx_smbus_init(Object *obj)
     sysbus_init_mmio(sbd, &s->iomem);
 
     s->bus = i2c_init_bus(DEVICE(s), "i2c-bus");
-    s->status = NPCM7XX_SMBUS_STATUS_IDLE;
 }
 
 static const VMStateDescription vmstate_npcm7xx_smbus = {
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Philippe Mathieu-Daudé

The STATUS register will be reset to IDLE in
cnpcm7xx_smbus_enter_reset(), no need to preset
it in instance_init().

Quoted 21 lines
---
 hw/i2c/npcm7xx_smbus.c | 1 -
 1 file changed, 1 deletion(-)
hw/i2c/npcm7xx_smbus.c +0 -2
index 6b2f9e1aaad..e7e0ba66fe7 100644
@@ -1040,7 +1040,6 @@ static void npcm7xx_smbus_init(Object *obj)
     sysbus_init_mmio(sbd, &s->iomem);
 
     s->bus = i2c_init_bus(DEVICE(s), "i2c-bus");
-    s->status = NPCM7XX_SMBUS_STATUS_IDLE;
 }
 
 static const VMStateDescription vmstate_npcm7xx_smbus = {
--

2.26.2

#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 15 lines · Philippe Mathieu-Daudé

The STATUS register will be reset to IDLE in
cnpcm7xx_smbus_enter_reset(), no need to preset
it in instance_init().

---
 hw/i2c/npcm7xx_smbus.c | 1 -
 1 file changed, 1 deletion(-)
hw/i2c/npcm7xx_smbus.c +0 -0
index 6b2f9e1aaad..e7e0ba66fe7 100644

hw/i2c/npcm7xx_smbus.c static void npcm7xx_smbus_init(Object *obj) · line 1045

Quoted 7 lines
hw/i2c/npcm7xx_smbus.c +0 -1
@@ -1040,7 +1040,6 @@ static void npcm7xx_smbus_init(Object *obj)
     sysbus_init_mmio(sbd, &s->iomem);
 
     s->bus = i2c_init_bus(DEVICE(s), "i2c-bus");
-    s->status = NPCM7XX_SMBUS_STATUS_IDLE;
 }
 
 static const VMStateDescription vmstate_npcm7xx_smbus =

Applied to target-arm.next, thanks.

-- PMM