qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/char/parallel: Convert reset handler to DeviceReset
@ 2020-05-04  9:56 Philippe Mathieu-Daudé
  2020-05-12  6:53 ` Philippe Mathieu-Daudé
  2020-05-13 15:27 ` Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-04  9:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Philippe Mathieu-Daudé,
	Marc-André Lureau, Michael S. Tsirkin

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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/char/parallel: Convert reset handler to DeviceReset
  2020-05-04  9:56 [PATCH] hw/char/parallel: Convert reset handler to DeviceReset Philippe Mathieu-Daudé
@ 2020-05-12  6:53 ` Philippe Mathieu-Daudé
  2020-05-13 15:27 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-12  6:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Michael S. Tsirkin, Marc-André Lureau

ping?

On 5/4/20 11:56 AM, Philippe Mathieu-Daudé wrote:
> 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);
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/char/parallel: Convert reset handler to DeviceReset
  2020-05-04  9:56 [PATCH] hw/char/parallel: Convert reset handler to DeviceReset Philippe Mathieu-Daudé
  2020-05-12  6:53 ` Philippe Mathieu-Daudé
@ 2020-05-13 15:27 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2020-05-13 15:27 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Paolo Bonzini, Michael S. Tsirkin, Marc-André Lureau

On 5/4/20 2:56 AM, Philippe Mathieu-Daudé wrote:
> 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(-)

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


r~


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-13 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-04  9:56 [PATCH] hw/char/parallel: Convert reset handler to DeviceReset Philippe Mathieu-Daudé
2020-05-12  6:53 ` Philippe Mathieu-Daudé
2020-05-13 15:27 ` Richard Henderson

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).