[PATCH 5/8] iio: pressure: bmp280: make reg_write callback take const void *

Link Mauve linkmauve at linkmauve.fr
Wed Jul 15 10:52:21 PDT 2026


The previous commit switched from a pointer to mutable data to a pointer
to immutable data, so let’s fix all users of the nvmem_config API.

Signed-off-by: Link Mauve <linkmauve at linkmauve.fr>
---
 drivers/iio/pressure/bmp280-core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index 990340a9b10c..0a39c5f39378 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -2261,11 +2261,11 @@ static int bmp580_nvmem_read(void *priv, unsigned int offset, void *val,
 	return ret;
 }
 
-static int bmp580_nvmem_write_impl(void *priv, unsigned int offset, void *val,
+static int bmp580_nvmem_write_impl(void *priv, unsigned int offset, const void *val,
 				   size_t bytes)
 {
 	struct bmp280_data *data = priv;
-	u16 *buf = val;
+	const u16 *buf = val;
 	int ret, addr;
 
 	guard(mutex)(&data->lock);
@@ -2322,7 +2322,7 @@ static int bmp580_nvmem_write_impl(void *priv, unsigned int offset, void *val,
 	return ret;
 }
 
-static int bmp580_nvmem_write(void *priv, unsigned int offset, void *val,
+static int bmp580_nvmem_write(void *priv, unsigned int offset, const void *val,
 			      size_t bytes)
 {
 	struct bmp280_data *data = priv;
-- 
2.55.0




More information about the linux-amlogic mailing list