[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/53] dino: use QOM cast instead of directly referencing parent_o
From: |
Mark Cave-Ayland |
Subject: |
[PULL 09/53] dino: use QOM cast instead of directly referencing parent_obj |
Date: |
Sun, 8 May 2022 20:56:06 +0100 |
Use a QOM cast in both dino_chip_read_with_attrs() and
dino_chip_write_with_attrs()
instead of directly referencing parent_obj.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20220504092600.10048-10-mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/hppa/dino.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c
index d3cd8578a1..77b8089664 100644
--- a/hw/hppa/dino.c
+++ b/hw/hppa/dino.c
@@ -205,6 +205,7 @@ static MemTxResult dino_chip_read_with_attrs(void *opaque,
hwaddr addr,
MemTxAttrs attrs)
{
DinoState *s = opaque;
+ PCIHostState *phb = PCI_HOST_BRIDGE(s);
MemTxResult ret = MEMTX_OK;
AddressSpace *io;
uint16_t ioaddr;
@@ -214,7 +215,7 @@ static MemTxResult dino_chip_read_with_attrs(void *opaque,
hwaddr addr,
case DINO_PCI_IO_DATA ... DINO_PCI_IO_DATA + 3:
/* Read from PCI IO space. */
io = &address_space_io;
- ioaddr = s->parent_obj.config_reg + (addr & 3);
+ ioaddr = phb->config_reg + (addr & 3);
switch (size) {
case 1:
val = address_space_ldub(io, ioaddr, attrs, &ret);
@@ -297,6 +298,7 @@ static MemTxResult dino_chip_write_with_attrs(void *opaque,
hwaddr addr,
MemTxAttrs attrs)
{
DinoState *s = opaque;
+ PCIHostState *phb = PCI_HOST_BRIDGE(s);
AddressSpace *io;
MemTxResult ret;
uint16_t ioaddr;
@@ -308,7 +310,7 @@ static MemTxResult dino_chip_write_with_attrs(void *opaque,
hwaddr addr,
case DINO_IO_DATA ... DINO_PCI_IO_DATA + 3:
/* Write into PCI IO space. */
io = &address_space_io;
- ioaddr = s->parent_obj.config_reg + (addr & 3);
+ ioaddr = phb->config_reg + (addr & 3);
switch (size) {
case 1:
address_space_stb(io, ioaddr, val, attrs, &ret);
--
2.20.1
- [PULL 00/53] qemu-sparc queue 20220508, Mark Cave-Ayland, 2022/05/08
- [PULL 01/53] dino: checkpatch fixes, Mark Cave-Ayland, 2022/05/08
- [PULL 02/53] dino: move registers from dino_init() to DINO_PCI_BRIDGE init function, Mark Cave-Ayland, 2022/05/08
- [PULL 03/53] dino: move PCI bus initialisation to dino_pcihost_init(), Mark Cave-Ayland, 2022/05/08
- [PULL 04/53] dino: move PCI windows initialisation to dino_pcihost_init(), Mark Cave-Ayland, 2022/05/08
- [PULL 05/53] dino: add memory-as property containing a link to the memory address space, Mark Cave-Ayland, 2022/05/08
- [PULL 06/53] dino: move pci_setup_iommu() to dino_pcihost_init(), Mark Cave-Ayland, 2022/05/08
- [PULL 07/53] dino: move PCI bus master address space setup to dino_pcihost_realize(), Mark Cave-Ayland, 2022/05/08
- [PULL 08/53] dino: move initial register configuration to new dino_pcihost_reset() function, Mark Cave-Ayland, 2022/05/08
- [PULL 09/53] dino: use QOM cast instead of directly referencing parent_obj,
Mark Cave-Ayland <=
- [PULL 10/53] dino: return PCIBus from dino_init() using qdev_get_child_bus(), Mark Cave-Ayland, 2022/05/08
- [PULL 11/53] dino: split declarations from dino.c into dino.h, Mark Cave-Ayland, 2022/05/08
- [PULL 12/53] hppa: use new CONFIG_HPPA_B160L option instead of CONFIG_DINO to build hppa machine, Mark Cave-Ayland, 2022/05/08
- [PULL 13/53] dino: change dino_init() to return the DINO device instead of PCIBus, Mark Cave-Ayland, 2022/05/08
- [PULL 14/53] machine.c: map DINO device during board configuration, Mark Cave-Ayland, 2022/05/08
- [PULL 15/53] dino.h: add defines for DINO IRQ numbers, Mark Cave-Ayland, 2022/05/08
- [PULL 16/53] dino: define IRQ inputs as qdev GPIOs, Mark Cave-Ayland, 2022/05/08
- [PULL 17/53] dino: wire up serial IRQ using a qdev GPIO in machine.c, Mark Cave-Ayland, 2022/05/08
- [PULL 18/53] dino: remove unused dino_set_timer_irq() IRQ handler, Mark Cave-Ayland, 2022/05/08
- [PULL 23/53] lasi: checkpatch fixes, Mark Cave-Ayland, 2022/05/08