Hi Peter,

> Hi -- a couple of general notes about device modelling
> which might apply to other devices in this series as well:
> 
>> +static void nrf51_rng_class_init(ObjectClass *klass, void *data)
>> +{
>> +    DeviceClass *dc = DEVICE_CLASS(klass);
>> +
>> +    dc->props = nrf51_rng_properties;
> 
> In general, every device that has any modifiable state needs:
>  * a reset function
>  * a vmstate struct that defines its state for migration
> 
> These get set up in the class init function by setting
> dc->vmsd and dc->reset.
> 
> For devices that don't have any modifiable state, a comment
> in the init function to say so helps to reassure readers
> that the issue has been considered :-)

Thank you for your remarks!
I will add the missing handler/structure. I will have to revise the
other devices i have pending for comments as well!

> 
>> +}
> 
> 
>> +    struct {
>> +        uint32_t active:1;
>> +        uint32_t event_valrdy:1;
>> +        uint32_t shortcut_stop_on_valrdy:1;
>> +        uint32_t interrupt_enabled:1;
>> +        uint32_t filter_enabled:1;
>> +    } state;
> 
> Prefer to avoid bitfields.

Will do!

Steffen

Reply via email to