qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Cc: "Hervé Poussineau" <hpoussin@reactos.org>
Subject: [Qemu-devel] [PATCH] m48t59: Fix a wrong opaque passed to nvram read and write routines
Date: Sun,  2 Jan 2011 19:44:49 +0100	[thread overview]
Message-ID: <1293993889-16276-1-git-send-email-hpoussin@reactos.org> (raw)

This unregresses Sun4m and PPC prep/ref405ep machines

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/m48t59.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/m48t59.c b/hw/m48t59.c
index 6991e2e..2020487 100644
--- a/hw/m48t59.c
+++ b/hw/m48t59.c
@@ -642,6 +642,7 @@ M48t59State *m48t59_init(qemu_irq IRQ, target_phys_addr_t mem_base,
     DeviceState *dev;
     SysBusDevice *s;
     M48t59SysBusState *d;
+    M48t59State *state;
 
     dev = qdev_create(NULL, "m48t59");
     qdev_prop_set_uint32(dev, "type", type);
@@ -649,18 +650,18 @@ M48t59State *m48t59_init(qemu_irq IRQ, target_phys_addr_t mem_base,
     qdev_prop_set_uint32(dev, "io_base", io_base);
     qdev_init_nofail(dev);
     s = sysbus_from_qdev(dev);
+    d = FROM_SYSBUS(M48t59SysBusState, s);
+    state = &d->state;
     sysbus_connect_irq(s, 0, IRQ);
     if (io_base != 0) {
-        register_ioport_read(io_base, 0x04, 1, NVRAM_readb, s);
-        register_ioport_write(io_base, 0x04, 1, NVRAM_writeb, s);
+        register_ioport_read(io_base, 0x04, 1, NVRAM_readb, state);
+        register_ioport_write(io_base, 0x04, 1, NVRAM_writeb, state);
     }
     if (mem_base != 0) {
         sysbus_mmio_map(s, 0, mem_base);
     }
 
-    d = FROM_SYSBUS(M48t59SysBusState, s);
-
-    return &d->state;
+    return state;
 }
 
 M48t59State *m48t59_init_isa(uint32_t io_base, uint16_t size, int type)
-- 
1.7.2.3

             reply	other threads:[~2011-01-02 18:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-02 18:44 Hervé Poussineau [this message]
2011-01-05 21:54 ` [Qemu-devel] [PATCH] m48t59: Fix a wrong opaque passed to nvram read and write routines Andreas Färber
2011-01-16 21:16 ` Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1293993889-16276-1-git-send-email-hpoussin@reactos.org \
    --to=hpoussin@reactos.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).