[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 022/173] exynos4210_fimd: QOM cast cleanup
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 022/173] exynos4210_fimd: QOM cast cleanup |
Date: |
Mon, 29 Jul 2013 21:17:59 +0200 |
Introduce a type constant, use QOM casts and rename the parent field.
Signed-off-by: Andreas Färber <address@hidden>
---
hw/display/exynos4210_fimd.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
index eb168ea..65cca1d 100644
--- a/hw/display/exynos4210_fimd.c
+++ b/hw/display/exynos4210_fimd.c
@@ -292,8 +292,13 @@ struct Exynos4210fimdWindow {
hwaddr fb_len; /* Framebuffer length */
};
+#define TYPE_EXYNOS4210_FIMD "exynos4210.fimd"
+#define EXYNOS4210_FIMD(obj) \
+ OBJECT_CHECK(Exynos4210fimdState, (obj), TYPE_EXYNOS4210_FIMD)
+
typedef struct {
- SysBusDevice busdev;
+ SysBusDevice parent_obj;
+
MemoryRegion iomem;
QemuConsole *console;
qemu_irq irq[3];
@@ -1108,6 +1113,7 @@ static inline int fimd_get_buffer_id(Exynos4210fimdWindow
*w)
* VIDOSDA, VIDOSDB, VIDWADDx and SHADOWCON registers */
static void fimd_update_memory_section(Exynos4210fimdState *s, unsigned win)
{
+ SysBusDevice *sbd = SYS_BUS_DEVICE(s);
Exynos4210fimdWindow *w = &s->window[win];
hwaddr fb_start_addr, fb_mapped_len;
@@ -1131,8 +1137,8 @@ static void
fimd_update_memory_section(Exynos4210fimdState *s, unsigned win)
* does not support hot-unplug.
*/
memory_region_unref(w->mem_section.mr);
- w->mem_section = memory_region_find(sysbus_address_space(&s->busdev),
- fb_start_addr, w->fb_len);
+ w->mem_section = memory_region_find(sysbus_address_space(sbd),
+ fb_start_addr, w->fb_len);
assert(w->mem_section.mr);
assert(w->mem_section.offset_within_address_space == fb_start_addr);
DPRINT_TRACE("Window %u framebuffer changed: address=0x%08x, len=0x%x\n",
@@ -1328,7 +1334,7 @@ static void exynos4210_fimd_update(void *opaque)
static void exynos4210_fimd_reset(DeviceState *d)
{
- Exynos4210fimdState *s = DO_UPCAST(Exynos4210fimdState, busdev.qdev, d);
+ Exynos4210fimdState *s = EXYNOS4210_FIMD(d);
unsigned w;
DPRINT_TRACE("Display controller reset\n");
@@ -1900,7 +1906,7 @@ static const GraphicHwOps exynos4210_fimd_ops = {
static int exynos4210_fimd_init(SysBusDevice *dev)
{
- Exynos4210fimdState *s = FROM_SYSBUS(Exynos4210fimdState, dev);
+ Exynos4210fimdState *s = EXYNOS4210_FIMD(dev);
s->ifb = NULL;
@@ -1927,7 +1933,7 @@ static void exynos4210_fimd_class_init(ObjectClass
*klass, void *data)
}
static const TypeInfo exynos4210_fimd_info = {
- .name = "exynos4210.fimd",
+ .name = TYPE_EXYNOS4210_FIMD,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(Exynos4210fimdState),
.class_init = exynos4210_fimd_class_init,
--
1.8.1.4
- [Qemu-devel] [PULL 012/173] pcie_port: Turn PCIEPort and PCIESlot into abstract QOM types, (continued)
- [Qemu-devel] [PULL 012/173] pcie_port: Turn PCIEPort and PCIESlot into abstract QOM types, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 013/173] etraxfs_ser: QOM cast cleanups, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 016/173] cs4231: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 014/173] xilinx_uartlite: Rename xlx_uartlite to XilinxUARTLite, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 015/173] xilinx_uartlite: QOM cast cleanups, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 017/173] audio/marvell_88w8618: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 018/173] milkymist-ac97: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 019/173] pl041: Rename pl041_state to PL041State, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 020/173] pl041: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 021/173] onenand: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 022/173] exynos4210_fimd: QOM cast cleanup,
Andreas Färber <=
- [Qemu-devel] [PULL 023/173] g364fb: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 024/173] jazz_led: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 025/173] milkymist-tmu2: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 028/173] pl110: QOM'ify pl110, pl110_versatile and pl111, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 030/173] imx_avic: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 026/173] milkymist-vgafb: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 031/173] imx_ccm: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 027/173] pl110: Rename pl110_state to PL110State, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 029/173] tcx: QOM cast cleanup, Andreas Färber, 2013/07/29
- [Qemu-devel] [PULL 032/173] armv7m: QOM cast cleanup for BitBandState, Andreas Färber, 2013/07/29