qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [PATCH] hw/char/parallel: Convert reset handler to DeviceReset
Date: Mon,  4 May 2020 11:56:23 +0200	[thread overview]
Message-ID: <20200504095623.7252-1-f4bug@amsat.org> (raw)

As TYPE_ISA_PARALLEL inherits from TYPE_ISA_DEVICE, it also
inherits from the DEVICE methods. Convert its reset handler
into a proper DeviceReset method.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/char/parallel.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 8dd67d1375..f68a96da8e 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -523,6 +523,13 @@ static int parallel_can_receive(void *opaque)
      return 1;
 }
 
+static void parallel_isa_reset(DeviceState *dev)
+{
+    ISAParallelState *isa = ISA_PARALLEL(dev);
+
+    parallel_reset(&isa->state);
+}
+
 static void parallel_isa_realizefn(DeviceState *dev, Error **errp)
 {
     static int index;
@@ -552,7 +559,6 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp)
 
     base = isa->iobase;
     isa_init_irq(isadev, &s->irq, isa->isairq);
-    qemu_register_reset(parallel_reset, s);
 
     qemu_chr_fe_set_handlers(&s->chr, parallel_can_receive, NULL,
                              NULL, NULL, s, NULL, true);
@@ -625,6 +631,7 @@ static void parallel_isa_class_initfn(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
 
+    dc->reset = parallel_isa_reset;
     dc->realize = parallel_isa_realizefn;
     dc->vmsd = &vmstate_parallel_isa;
     device_class_set_props(dc, parallel_isa_properties);
-- 
2.21.3



             reply	other threads:[~2020-05-04  9:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04  9:56 Philippe Mathieu-Daudé [this message]
2020-05-12  6:53 ` [PATCH] hw/char/parallel: Convert reset handler to DeviceReset Philippe Mathieu-Daudé
2020-05-13 15:27 ` Richard Henderson

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=20200504095623.7252-1-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).