summaryrefslogtreecommitdiff
path: root/drivers/staging/sm750fb/ddk750_chip.h
diff options
context:
space:
mode:
authorMatthieu Simon <gmatthsim@gmail.com>2017-02-07 22:48:43 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-09 13:23:13 +0100
commitc075b6f2d357ea91e8ef01e860571e7d151f3aa3 (patch)
tree709da17d18f67294f1dd821d46d199cc1aac17c5 /drivers/staging/sm750fb/ddk750_chip.h
parent0840ff76902da3c92ecda4660ee3b1a795bbc09d (diff)
staging: sm750fb: Replace POKE32 and PEEK32 by inline functions
POKE32 and PEEK32 have been replaced by inlined functions poke32 and peek32. Having inline functions instead of macros help to get the correct type-checking and avoid the possible precedence issues reported by checkpatch. Signed-off-by: Matthieu Simon <gmatthsim@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm750fb/ddk750_chip.h')
-rw-r--r--drivers/staging/sm750fb/ddk750_chip.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
index e63b8b293816..fbeb615aa432 100644
--- a/drivers/staging/sm750fb/ddk750_chip.h
+++ b/drivers/staging/sm750fb/ddk750_chip.h
@@ -9,11 +9,18 @@
#include <linux/ioport.h>
#include <linux/uaccess.h>
+extern void __iomem *mmio750;
+
/* software control endianness */
-#define PEEK32(addr) readl(addr + mmio750)
-#define POKE32(addr, data) writel(data, addr + mmio750)
+static inline u32 peek32(u32 addr)
+{
+ return readl(addr + mmio750);
+}
-extern void __iomem *mmio750;
+static inline void poke32(u32 data, u32 addr)
+{
+ writel(data, addr + mmio750);
+}
/* This is all the chips recognized by this library */
typedef enum _logical_chip_type_t {