On Sun, Sep 27, 2015 at 8:25 PM, Peter Crosthwaite <crosthwaitepe...@gmail.com> wrote: > On Sun, Sep 27, 2015 at 10:16 AM, Max Filippov <jcmvb...@gmail.com> wrote: >> pflash_cfi01_register always registers FLASH to the default >> system_memory region, which may not always be the right thing. >> >> Provide pflash_cfi01_init function that only creates FLASH device and >> sets its properties, leaving MMIO region registration to its caller. >> > > You should just use QOM to create your device inline without need for > a construction helper. See Vexpress's ve_pflash_cfi01_register for an > example.
I thought about it and it looks like a lot of boilerplate code for nothing. Maybe it'd be better to remove qdev_init_nofail call from that init function and let ve_pflash_cfi01_register reuse it too? -- Thanks. -- Max