qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 3/6] hw/char: QOM'ify lm32_juart.c


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 3/6] hw/char: QOM'ify lm32_juart.c
Date: Mon, 9 May 2016 12:43:00 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1


On 29/03/2016 09:47, xiaoqiang zhao wrote:
>  
>      /* FIXME use a qdev chardev prop instead of qemu_char_get_next_serial() 
> */
>      s->chr = qemu_char_get_next_serial();
>      if (s->chr) {
>          qemu_chr_add_handlers(s->chr, juart_can_rx, juart_rx, juart_event, 
> s);
>      }

This is wrong, for the usual reason that instance_init cannot touch
globals.  The right thing to do here would be to add a chardev property
to the device as in the FIXME; at this point, it is obvious that the
rest must be in a init or realize callback, because the properties are
not available in init.

Same for patch 4.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]