[PATCH v3 1/2] clocksource: Update to the newer memory functions.

From: Xiubo Li
Date: Tue Sep 30 2014 - 01:04:13 EST

Use ioread{16,32} instead of read{w,l}_relaxed.

For read{w,l}_relaxed accessor, if one arch has its own defination,
then used it. Or will use the generic one, which will be read as LE
endian as default.

For some ARCHes, such PowerPC, if using the clocksource mmio, the
read{w,l}_relaxed will couldn't be used directly. There must be its
own BE accessor in its individual clocksource driver.

The ioread{16,32} will be read as LE endian as default if the arch
hasn't any defination of it too, like read{w,l}_relaxed do.

To prepare supporting the BE APIs and to be more unified with them,
using ioread{16,32}[be] is a good chioce here.

Signed-off-by: Xiubo Li <Li.Xiubo@xxxxxxxxxxxxx>
drivers/clocksource/mmio.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/mmio.c b/drivers/clocksource/mmio.c
index 1593ade..d3cbf70 100644
--- a/drivers/clocksource/mmio.c
+++ b/drivers/clocksource/mmio.c
@@ -22,22 +22,22 @@ static inline struct clocksource_mmio *to_mmio_clksrc(struct clocksource *c)

cycle_t clocksource_mmio_readl_up(struct clocksource *c)
- return (cycle_t)readl_relaxed(to_mmio_clksrc(c)->reg);
+ return (cycle_t)ioread32(to_mmio_clksrc(c)->reg);

cycle_t clocksource_mmio_readl_down(struct clocksource *c)
- return ~(cycle_t)readl_relaxed(to_mmio_clksrc(c)->reg) & c->mask;
+ return ~(cycle_t)ioread32(to_mmio_clksrc(c)->reg) & c->mask;

cycle_t clocksource_mmio_readw_up(struct clocksource *c)
- return (cycle_t)readw_relaxed(to_mmio_clksrc(c)->reg);
+ return (cycle_t)ioread16(to_mmio_clksrc(c)->reg);

cycle_t clocksource_mmio_readw_down(struct clocksource *c)
- return ~(cycle_t)readw_relaxed(to_mmio_clksrc(c)->reg) & c->mask;
+ return ~(cycle_t)ioread16(to_mmio_clksrc(c)->reg) & c->mask;


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/