summaryrefslogtreecommitdiff
path: root/hw/omap_i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/omap_i2c.c')
-rw-r--r--hw/omap_i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/omap_i2c.c b/hw/omap_i2c.c
index af00be3207..878c046ce3 100644
--- a/hw/omap_i2c.c
+++ b/hw/omap_i2c.c
@@ -194,7 +194,7 @@ void omap_i2c_reset(struct omap_i2c_s *s)
static uint32_t omap_i2c_read(void *opaque, target_phys_addr_t addr)
{
struct omap_i2c_s *s = (struct omap_i2c_s *) opaque;
- int offset = addr - s->base;
+ int offset = addr & OMAP_MPUI_REG_MASK;
uint16_t ret;
switch (offset) {
@@ -286,7 +286,7 @@ static void omap_i2c_write(void *opaque, target_phys_addr_t addr,
uint32_t value)
{
struct omap_i2c_s *s = (struct omap_i2c_s *) opaque;
- int offset = addr - s->base;
+ int offset = addr & OMAP_MPUI_REG_MASK;
int nack;
switch (offset) {