[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/10] aspeed/smc: Remove the 'flash' attribute from AspeedSM
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 05/10] aspeed/smc: Remove the 'flash' attribute from AspeedSMCFlash |
Date: |
Tue, 7 Sep 2021 12:21:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
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é <f4bug@amsat.org>
- Re: [PATCH 07/10] aspeed/smc: Rename AspeedSMCFlash 'id' to 'cs', (continued)
- [PATCH 10/10] aspeed/smc: Introduce an addr_width() class handler, Cédric Le Goater, 2021/09/07
- [PATCH 09/10] aspeed/smc: Add default reset values, Cédric Le Goater, 2021/09/07
- [PATCH 01/10] aspeed/smc: Add watchdog Control/Status Registers, Cédric Le Goater, 2021/09/07
- [PATCH 02/10] aspeed/smc: Introduce aspeed_smc_error() helper, Cédric Le Goater, 2021/09/07
- [PATCH 05/10] aspeed/smc: Remove the 'flash' attribute from AspeedSMCFlash, Cédric Le Goater, 2021/09/07
- [PATCH 04/10] aspeed/smc: Drop AspeedSMCController structure, Cédric Le Goater, 2021/09/07
- [PATCH 06/10] aspeed/smc: Remove the 'size' attribute from AspeedSMCFlash, Cédric Le Goater, 2021/09/07
- [PATCH 03/10] aspeed/smc: Stop using the model name for the memory regions, Cédric Le Goater, 2021/09/07
- [PATCH 08/10] aspeed/smc: QOMify AspeedSMCFlash, Cédric Le Goater, 2021/09/07
- Re: [PATCH 00/10] aspeed/smc: Cleanups and QOMification, Joel Stanley, 2021/09/07