rust: pl011: always use reset() method on registers
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 4 Dec 2024 15:44:42 +0000 (16:44 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 19 Dec 2024 18:36:38 +0000 (19:36 +0100)
commitf65314bdd0c287097f7dd4b002c67ceee9729039
tree4e3551aba5bbc6547d56686078710559951303d2
parentac096b0bef98a79fafb1254fef121a175c9b73fc
rust: pl011: always use reset() method on registers

For CR, the ugly-ish "0.into()" idiom is already hidden within the
reset method.  Do not repeat it.

For FR, standardize on reset() being equivalent to "*self = Self::default()"
and let reset_fifo toggle only the bits that are related to FIFOs.  This
commit also reproduces C commit 02b1f7f6192 ("hw/char/pl011: Split RX/TX
path of pl011_reset_fifo()", 2024-09-13).

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/hw/char/pl011/src/device.rs
rust/hw/char/pl011/src/lib.rs