Skip to contentSkip to conversation

hw/arm/mps2-tz: Use TYPE_IOTKIT instead of hardcoded string

PATCH Applied Philippe Mathieu-Daudé 2 participants 2 messages Apr 28, 2020 – Apr 30, 2020 Arm/versatile express platform

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm/mps2-tz: Use TYPE_IOTKIT instead of hardcoded string

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).

---
 hw/arm/mps2-tz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/mps2-tz.c +1 -1
index a8dea7dde1..2c43041564 100644
@@ -395,7 +395,7 @@ static void mps2tz_common_init(MachineState *machine)
         exit(EXIT_FAILURE);
     }
 
-    sysbus_init_child_obj(OBJECT(machine), "iotkit", &mms->iotkit,
+    sysbus_init_child_obj(OBJECT(machine), TYPE_IOTKIT, &mms->iotkit,
                           sizeof(mms->iotkit), mmc->armsse_type);
     iotkitdev = DEVICE(&mms->iotkit);
     object_property_set_link(OBJECT(&mms->iotkit), OBJECT(system_memory),
Signature · 1 line
2.21.1
#1 lore raw
Quoted 9 lines · Philippe Mathieu-Daudé

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).

---
 hw/arm/mps2-tz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to target-arm.next, thanks.

-- PMM