Skip to content

Commit

Permalink
rtc: at91sam9: use standard readl/writel functions instead of raw ver…
Browse files Browse the repository at this point in the history
…sions

Raw versions of writel and writel should not be directly used and should
be replaced by their relaxed versions (readl/writel_relaxed), which take
endianness conversion into account.

In this driver we prefer the standard readl/writel function which add the
appropriate memory barrier around the access (the performance penalty is
negligible for this kind of application).

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Johan Hovold <johan@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
  • Loading branch information
Boris BREZILLON authored and Nicolas Ferre committed Nov 13, 2014
1 parent 6575bd7 commit 272f1df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/rtc/rtc-at91sam9.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ struct sam9_rtc {
};

#define rtt_readl(rtc, field) \
__raw_readl((rtc)->rtt + AT91_RTT_ ## field)
readl((rtc)->rtt + AT91_RTT_ ## field)
#define rtt_writel(rtc, field, val) \
__raw_writel((val), (rtc)->rtt + AT91_RTT_ ## field)
writel((val), (rtc)->rtt + AT91_RTT_ ## field)

#define gpbr_readl(rtc) \
__raw_readl((rtc)->gpbr)
readl((rtc)->gpbr)
#define gpbr_writel(rtc, val) \
__raw_writel((val), (rtc)->gpbr)
writel((val), (rtc)->gpbr)

/*
* Read current time and date in RTC
Expand Down

0 comments on commit 272f1df

Please sign in to comment.