diff mbox series

[v2,07/19] hw/timer/arm_timer: Rename TYPE_SP804 -> TYPE_SP804_TIMER

Message ID 20230704145012.49870-8-philmd@linaro.org
State New
Headers show
Series hw/timer/arm_timer: QOM'ify ARM_TIMER and correct sysbus/irq in ICP_PIT | expand

Commit Message

Philippe Mathieu-Daudé July 4, 2023, 2:50 p.m. UTC
Having a QOM object using its device type as suffix is
often helpful.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/timer/arm_timer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Richard Henderson July 5, 2023, 3:34 p.m. UTC | #1
On 7/4/23 16:50, Philippe Mathieu-Daudé wrote:
> Having a QOM object using its device type as suffix is
> often helpful.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   hw/timer/arm_timer.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c
index 41045de8ed..8dae845998 100644
--- a/hw/timer/arm_timer.c
+++ b/hw/timer/arm_timer.c
@@ -191,8 +191,8 @@  static ArmTimer *arm_timer_init(uint32_t freq)
  * https://developer.arm.com/documentation/ddi0271/latest/
  */
 
-#define TYPE_SP804 "sp804"
-OBJECT_DECLARE_SIMPLE_TYPE(SP804Timer, SP804)
+#define TYPE_SP804_TIMER "sp804"
+OBJECT_DECLARE_SIMPLE_TYPE(SP804Timer, SP804_TIMER)
 
 struct SP804Timer {
     SysBusDevice parent_obj;
@@ -290,7 +290,7 @@  static const VMStateDescription vmstate_sp804 = {
 
 static void sp804_init(Object *obj)
 {
-    SP804Timer *s = SP804(obj);
+    SP804Timer *s = SP804_TIMER(obj);
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
 
     sysbus_init_irq(sbd, &s->irq);
@@ -301,7 +301,7 @@  static void sp804_init(Object *obj)
 
 static void sp804_realize(DeviceState *dev, Error **errp)
 {
-    SP804Timer *s = SP804(dev);
+    SP804Timer *s = SP804_TIMER(dev);
 
     s->timer[0] = arm_timer_init(s->freq0);
     s->timer[1] = arm_timer_init(s->freq1);
@@ -403,7 +403,7 @@  static const TypeInfo arm_timer_types[] = {
         .instance_init  = icp_pit_init,
 
     }, {
-        .name           = TYPE_SP804,
+        .name           = TYPE_SP804_TIMER,
         .parent         = TYPE_SYS_BUS_DEVICE,
         .instance_size  = sizeof(SP804Timer),
         .instance_init  = sp804_init,