summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_atmel.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/tpm/tpm_atmel.h')
-rw-r--r--drivers/char/tpm/tpm_atmel.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index 3fd929de9739..bced6780afe8 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -25,8 +25,14 @@
struct tpm_atmel_priv {
int region_size;
int have_region;
+ unsigned long base;
};
+static inline struct tpm_atmel_priv *atmel_get_priv(struct tpm_chip *chip)
+{
+ return chip->vendor.priv;
+}
+
#ifdef CONFIG_PPC64
#include <asm/prom.h>
@@ -83,8 +89,9 @@ static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size)
return ioremap(*base, *region_size);
}
#else
-#define atmel_getb(chip, offset) inb(chip->vendor->base + offset)
-#define atmel_putb(val, chip, offset) outb(val, chip->vendor->base + offset)
+#define atmel_getb(chip, offset) inb(atmel_get_priv(chip)->base + offset)
+#define atmel_putb(val, chip, offset) \
+ outb(val, atmel_get_priv(chip)->base + offset)
#define atmel_request_region request_region
#define atmel_release_region release_region
/* Atmel definitions */
OpenPOWER on IntegriCloud