On 02/23/2013 06:13 PM, Andreas Färber wrote: > Am 19.02.2013 17:22, schrieb Fabien Chouteau: >> >> +static void grlib_apbuart_reset(DeviceState *d) >> +{ >> + UART *uart = container_of(d, UART, busdev.qdev); > > This is still wrong, please introduce a QOM cast macro for this device, > e.g., GRLIB_APB_UART(d) due to the unfortunate use of UART rather than > UARTState for the struct.
Hello, Changing UART to UARTState is not difficult, but I don't understand why the current name is a problem. > > http://wiki.qemu.org/QOMConventions > I didn't know this page. I think it would be great to have an example for each point. Or maybe a complete "dummy" device that shows the best practices. > Also if you have some cycles, all SysBus init functions such as the one > visible above should be replaced by instance_init and realize functions. > You mean dc->init instead of k->init? -- Fabien Chouteau