[PATCH 3/6] rtc: fall back to ->{read,write}8_array if ->{read,write}8 are not provided

Simon Glass sjg at chromium.org
Wed May 6 05:42:36 CEST 2020


On Mon, 4 May 2020 at 15:20, Rasmus Villemoes
<rasmus.villemoes at prevas.dk> wrote:
>
> Similar to how the rtc_{read,write}8_array functions fall back to
> using the {read,write}8 methods, do the opposite in the
> rtc_{read,write}8 functions.
>
> This way, each driver only needs to provide either ->read8 or
> ->read8_array to make both rtc_read8() and rtc_read8_array() work -
> without this, a driver that provides rtc_read8_array() would most
> likely just duplicate the logic here for implementing a ->read8()
> method in term of its ->read8_array() method. The same remarks of
> course apply to the write case.
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
> ---
>  drivers/rtc/rtc-uclass.c | 24 ++++++++++++++++++------
>  1 file changed, 18 insertions(+), 6 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>

Please make sure you add tests for these methods.


More information about the U-Boot mailing list