diff --git a/drivers/mtd/at24xx.c b/drivers/mtd/at24xx.c index e8842f8bdd..31e909334b 100644 --- a/drivers/mtd/at24xx.c +++ b/drivers/mtd/at24xx.c @@ -382,7 +382,7 @@ static ssize_t at24c_bwrite(FAR struct mtd_dev_s *dev, off_t startblock, size_t #else buf[0] = offset & 0xff; - I2C_SETADDRESS(priv->dev, address | ((offset >> 8) & 0x07), 7); + I2C_SETADDRESS(priv->dev, priv->addr | ((offset >> 8) & 0x07), 7); #endif while (I2C_WRITE(priv->dev, buf, AT24XX_ADDRSIZE) < 0)