[PATCH] hw/i2c/npcm7xx_smbus: Simplify npcm7xx_smbus_init()

Philippe Mathieu-Daudé posted 1 patch 3 years, 2 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210228224813.312532-1-f4bug@amsat.org
hw/i2c/npcm7xx_smbus.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] hw/i2c/npcm7xx_smbus: Simplify npcm7xx_smbus_init()
Posted by Philippe Mathieu-Daudé 3 years, 2 months ago
The STATUS register will be reset to IDLE in
cnpcm7xx_smbus_enter_reset(), no need to preset
it in instance_init().

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/i2c/npcm7xx_smbus.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/i2c/npcm7xx_smbus.c b/hw/i2c/npcm7xx_smbus.c
index 6b2f9e1aaad..e7e0ba66fe7 100644
--- a/hw/i2c/npcm7xx_smbus.c
+++ b/hw/i2c/npcm7xx_smbus.c
@@ -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

Re: [PATCH] hw/i2c/npcm7xx_smbus: Simplify npcm7xx_smbus_init()
Posted by Hao Wu 3 years, 2 months ago
On Sun, Feb 28, 2021 at 2:50 PM Philippe Mathieu-Daudé <f4bug@amsat.org>
wrote:

> The STATUS register will be reset to IDLE in
> cnpcm7xx_smbus_enter_reset(), no need to preset
> it in instance_init().
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
Reviewed-by: Hao Wu <wuhaotsh@google.com>

> ---
>  hw/i2c/npcm7xx_smbus.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/hw/i2c/npcm7xx_smbus.c b/hw/i2c/npcm7xx_smbus.c
> index 6b2f9e1aaad..e7e0ba66fe7 100644
> --- a/hw/i2c/npcm7xx_smbus.c
> +++ b/hw/i2c/npcm7xx_smbus.c
> @@ -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
>
>
>
Re: [PATCH] hw/i2c/npcm7xx_smbus: Simplify npcm7xx_smbus_init()
Posted by Peter Maydell 3 years, 2 months ago
On Sun, 28 Feb 2021 at 22:50, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> The STATUS register will be reset to IDLE in
> cnpcm7xx_smbus_enter_reset(), no need to preset
> it in instance_init().
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/i2c/npcm7xx_smbus.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/hw/i2c/npcm7xx_smbus.c b/hw/i2c/npcm7xx_smbus.c
> index 6b2f9e1aaad..e7e0ba66fe7 100644
> --- a/hw/i2c/npcm7xx_smbus.c
> +++ b/hw/i2c/npcm7xx_smbus.c
> @@ -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