[PATCH v2 08/13] iio: pressure: mprls0025pa: rename buffer variable

Petre Rodan
2026-01-14T10:07:53Z

For the reason of better naming consistency rename priv->buffer into
priv->rx_buf since tx_buf will get introduced in the next patch.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
---
v1 -> v2 no functional change
---
drivers/iio/pressure/mprls0025pa.c | 10 +++++-----
drivers/iio/pressure/mprls0025pa.h | 4 ++--
drivers/iio/pressure/mprls0025pa_i2c.c | 4 ++--
drivers/iio/pressure/mprls0025pa_spi.c | 2 +-
4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/pressure/mprls0025pa.c b/drivers/iio/pressure/mprls0025pa.c
index b0f70c9b503c..fd9c8ea61eb3 100644
--- a/drivers/iio/pressure/mprls0025pa.c
+++ b/drivers/iio/pressure/mprls0025pa.c
@@ -238,7 +238,7 @@ static int mpr_read_pressure(struct mpr_data *data, s32 *press)
ret);
return ret;
}
- if (!(data->buffer[0] & MPR_ST_ERR_FLAG))
+ if (!(data->rx_buf[0] & MPR_ST_ERR_FLAG))
break;
}
if (i == nloops) {
@@ -251,15 +251,15 @@ static int mpr_read_pressure(struct mpr_data *data, s32 *press)
if (ret < 0)
return ret;

- if (data->buffer[0] & MPR_ST_ERR_FLAG) {
+ if (data->rx_buf[0] & MPR_ST_ERR_FLAG) {
dev_err(data->dev,
- "unexpected status byte %02x\n", data->buffer[0]);
+ "unexpected status byte %02x\n", data->rx_buf[0]);
return -ETIMEDOUT;
}

- *press = get_unaligned_be24(&data->buffer[1]);
+ *press = get_unaligned_be24(&data->rx_buf[1]);

- dev_dbg(dev, "received: %*ph cnt: %d\n", ret, data->buffer, *press);
+ dev_dbg(dev, "received: %*ph cnt: %d\n", ret, data->rx_buf, *press);

return 0;
}
diff --git a/drivers/iio/pressure/mprls0025pa.h b/drivers/iio/pressure/mprls0025pa.h
index e34253af8e23..119ebb0ba567 100644
--- a/drivers/iio/pressure/mprls0025pa.h
+++ b/drivers/iio/pressure/mprls0025pa.h
@@ -54,7 +54,7 @@ enum mpr_func_id {
* @chan: channel values for buffered mode
* @chan.pres: pressure value
* @chan.ts: timestamp
- * @buffer: raw conversion data
+ * @rx_buf: raw conversion data
*/
struct mpr_data {
struct device *dev;
@@ -75,7 +75,7 @@ struct mpr_data {
s32 pres;
aligned_s64 ts;
} chan;
- u8 buffer[MPR_MEASUREMENT_RD_SIZE] __aligned(IIO_DMA_MINALIGN);
+ u8 rx_buf[MPR_MEASUREMENT_RD_SIZE] __aligned(IIO_DMA_MINALIGN);
};

struct mpr_ops {
diff --git a/drivers/iio/pressure/mprls0025pa_i2c.c b/drivers/iio/pressure/mprls0025pa_i2c.c
index 79811fd4a02b..36da0059b19f 100644
--- a/drivers/iio/pressure/mprls0025pa_i2c.c
+++ b/drivers/iio/pressure/mprls0025pa_i2c.c
@@ -30,8 +30,8 @@ static int mpr_i2c_read(struct mpr_data *data, const u8 unused, const u8 cnt)
if (cnt > MPR_MEASUREMENT_RD_SIZE)
return -EOVERFLOW;

- memset(data->buffer, 0, MPR_MEASUREMENT_RD_SIZE);
- ret = i2c_master_recv(client, data->buffer, cnt);
+ memset(data->rx_buf, 0, MPR_MEASUREMENT_RD_SIZE);
+ ret = i2c_master_recv(client, data->rx_buf, cnt);
if (ret < 0)
return ret;
else if (ret != cnt)
diff --git a/drivers/iio/pressure/mprls0025pa_spi.c b/drivers/iio/pressure/mprls0025pa_spi.c
index cf17eb2e7208..247b65226bb9 100644
--- a/drivers/iio/pressure/mprls0025pa_spi.c
+++ b/drivers/iio/pressure/mprls0025pa_spi.c
@@ -56,7 +56,7 @@ static int mpr_spi_xfer(struct mpr_data *data, const u8 cmd, const u8 pkt_len)
xfers[0].delay.unit = SPI_DELAY_UNIT_NSECS;

xfers[1].tx_buf = buf->tx;
- xfers[1].rx_buf = data->buffer;
+ xfers[1].rx_buf = data->rx_buf;
xfers[1].len = pkt_len;

return spi_sync_transfer(spi, xfers, ARRAY_SIZE(xfers));

--
2.52.0