[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 30/42] hw/arm: Use TYPE_VERSATILE_I2C instead of hardcoded string
From: |
Peter Maydell |
Subject: |
[PULL 30/42] hw/arm: Use TYPE_VERSATILE_I2C instead of hardcoded string |
Date: |
Tue, 23 Jun 2020 12:38:52 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
By using the TYPE_* definitions for devices, we can:
- quickly find where devices are used with 'git-grep'
- easily rename a device (one-line change).
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200617072539.32686-6-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/realview.c | 3 ++-
hw/arm/versatilepb.c | 3 ++-
hw/arm/vexpress.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index f3c00fe00cf..b6c0a1adb98 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -26,6 +26,7 @@
#include "hw/cpu/a9mpcore.h"
#include "hw/intc/realview_gic.h"
#include "hw/irq.h"
+#include "hw/i2c/arm_sbcon_i2c.h"
#define SMP_BOOT_ADDR 0xe0000000
#define SMP_BOOTREG_ADDR 0x10000030
@@ -282,7 +283,7 @@ static void realview_init(MachineState *machine,
}
}
- dev = sysbus_create_simple("versatile_i2c", 0x10002000, NULL);
+ dev = sysbus_create_simple(TYPE_VERSATILE_I2C, 0x10002000, NULL);
i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
i2c_create_slave(i2c, "ds1338", 0x68);
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index 2ebdcbd8ac3..e596b8170f4 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -18,6 +18,7 @@
#include "sysemu/sysemu.h"
#include "hw/pci/pci.h"
#include "hw/i2c/i2c.h"
+#include "hw/i2c/arm_sbcon_i2c.h"
#include "hw/irq.h"
#include "hw/boards.h"
#include "exec/address-spaces.h"
@@ -314,7 +315,7 @@ static void versatile_init(MachineState *machine, int
board_id)
/* Add PL031 Real Time Clock. */
sysbus_create_simple("pl031", 0x101e8000, pic[10]);
- dev = sysbus_create_simple("versatile_i2c", 0x10002000, NULL);
+ dev = sysbus_create_simple(TYPE_VERSATILE_I2C, 0x10002000, NULL);
i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
i2c_create_slave(i2c, "ds1338", 0x68);
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 7ca5d523a4c..24d656e6537 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -42,6 +42,7 @@
#include "hw/char/pl011.h"
#include "hw/cpu/a9mpcore.h"
#include "hw/cpu/a15mpcore.h"
+#include "hw/i2c/arm_sbcon_i2c.h"
#define VEXPRESS_BOARD_ID 0x8e0
#define VEXPRESS_FLASH_SIZE (64 * 1024 * 1024)
@@ -640,7 +641,7 @@ static void vexpress_common_init(MachineState *machine)
sysbus_create_simple("sp804", map[VE_TIMER01], pic[2]);
sysbus_create_simple("sp804", map[VE_TIMER23], pic[3]);
- dev = sysbus_create_simple("versatile_i2c", map[VE_SERIALDVI], NULL);
+ dev = sysbus_create_simple(TYPE_VERSATILE_I2C, map[VE_SERIALDVI], NULL);
i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
i2c_create_slave(i2c, "sii9022", 0x39);
--
2.20.1
- [PULL 19/42] target/arm: Convert Neon 2-reg-misc VRINT insns to decodetree, (continued)
- [PULL 19/42] target/arm: Convert Neon 2-reg-misc VRINT insns to decodetree, Peter Maydell, 2020/06/23
- [PULL 20/42] target/arm: Convert Neon 2-reg-misc VCVT insns to decodetree, Peter Maydell, 2020/06/23
- [PULL 21/42] target/arm: Convert Neon VSWP to decodetree, Peter Maydell, 2020/06/23
- [PULL 23/42] target/arm: Move some functions used only in translate-neon.inc.c to that file, Peter Maydell, 2020/06/23
- [PULL 24/42] target/arm: Remove unnecessary gen_io_end() calls, Peter Maydell, 2020/06/23
- [PULL 22/42] target/arm: Convert Neon VTRN to decodetree, Peter Maydell, 2020/06/23
- [PULL 25/42] target/arm: Remove dead code relating to SABA and UABA, Peter Maydell, 2020/06/23
- [PULL 26/42] hw/watchdog/cmsdk-apb-watchdog: Add trace event for lock status, Peter Maydell, 2020/06/23
- [PULL 28/42] hw/i2c/versatile_i2c: Add SCL/SDA definitions, Peter Maydell, 2020/06/23
- [PULL 27/42] hw/i2c/versatile_i2c: Add definitions for register addresses, Peter Maydell, 2020/06/23
- [PULL 30/42] hw/arm: Use TYPE_VERSATILE_I2C instead of hardcoded string,
Peter Maydell <=
- [PULL 29/42] hw/i2c: Add header for ARM SBCon two-wire serial bus interface, Peter Maydell, 2020/06/23
- [PULL 31/42] hw/arm/mps2: Document CMSDK/FPGA APB subsystem sections, Peter Maydell, 2020/06/23
- [PULL 34/42] hw/arm/mps2: Add CMSDK AHB GPIO peripherals as unimplemented devices, Peter Maydell, 2020/06/23
- [PULL 36/42] hw/arm/mps2: Add SPI devices, Peter Maydell, 2020/06/23
- [PULL 37/42] hw/arm/mps2: Add I2C devices, Peter Maydell, 2020/06/23
- [PULL 32/42] hw/arm/mps2: Rename CMSDK AHB peripheral region, Peter Maydell, 2020/06/23
- [PULL 38/42] hw/arm/mps2: Add audio I2S interface as unimplemented device, Peter Maydell, 2020/06/23
- [PULL 39/42] hw/arm/mps2-tz: Use the ARM SBCon two-wire serial bus interface, Peter Maydell, 2020/06/23
- [PULL 41/42] tests/qtest/arm-cpu-features: Add feature setting tests, Peter Maydell, 2020/06/23
- [PULL 40/42] target/arm: Check supported KVM features globally (not per vCPU), Peter Maydell, 2020/06/23