]> git.ipfire.org Git - thirdparty/qemu.git/commit - hw/misc/applesmc.c
hw/misc/applesmc: Simplify DeviceReset handler
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 8 Apr 2024 11:15:44 +0000 (13:15 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 25 Apr 2024 10:48:12 +0000 (12:48 +0200)
commita6ab7a98c9a8106cb8ef86cbc88a27fe69963423
treec0ce9fe28344489fe3ba9c912b2dbb1d91009cf1
parent63073574e8d5551dc31a30b59830b886e9f9dbfe
hw/misc/applesmc: Simplify DeviceReset handler

Have applesmc_find_key() return a const pointer.
Since the returned buffers are not modified in
applesmc_io_data_write(), it is pointless to
delete and re-add the keys in the DeviceReset
handler. Add them once in DeviceRealize, and
discard them in the DeviceUnrealize handler.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20240410180819.92332-1-philmd@linaro.org>
hw/misc/applesmc.c