On 9/7/21 11:40 AM, Cédric Le Goater wrote: > On 9/7/21 10:36 AM, Philippe Mathieu-Daudé wrote: >> On 9/7/21 8:58 AM, Cédric Le Goater wrote: >>> There is no use for it. >> >> Hmmm this is not the correct justification. >> >> This devices sits on a bus, so its state will be released when >> the bus is released. There is no need to release it manually, >> so we can remove the reference. > > That's what the code is doing AFAIUI. > > This is just removing the AspeedSMCFlash attribute because it is > not used anywhere else than under aspeed_board_init_flashes(). > > Is there anything else ? I am bit lost by your comment.
I was thinking of d4e1d8f57eb ("hw/arm/tosa: Encapsulate misc GPIO handling in a device"), if the device were not created on a bus, the we'd need to keep this reference, otherwise we'd leak it. Anyhow this is board code where we are not releasing anything. Maybe "There is no need to keep a reference of the flash qdev in the AspeedSMCFlash state: the SPI bus takes ownership and will release its resources. Remove AspeedSMCFlash::flash."? Anyway no big deal with the comment, Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org>