@@ -179,11 +179,11 @@ static int bcm_otpc_read(void *context, unsigned int offset, void *val,
return 0;
}
-static int bcm_otpc_write(void *context, unsigned int offset, void *val,
+static int bcm_otpc_write(void *context, unsigned int offset, const void *val,
size_t bytes)
{
struct otpc_priv *priv = context;
- u32 *buf = val;
+ const u32 *buf = val;
u32 bytes_written;
u32 address = offset / priv->config->word_size;
int i, ret;
@@ -178,11 +178,11 @@ static int imx_scu_ocotp_read(void *context, unsigned int offset,
}
static int imx_scu_ocotp_write(void *context, unsigned int offset,
- void *val, size_t bytes)
+ const void *val, size_t bytes)
{
struct ocotp_priv *priv = context;
struct arm_smccc_res res;
- u32 *buf = val;
+ const u32 *buf = val;
u32 tmp;
u32 index;
int ret;
@@ -310,11 +310,11 @@ static void imx_ocotp_set_imx7_timing(struct ocotp_priv *priv)
writel(timing, priv->base + IMX_OCOTP_ADDR_TIMING);
}
-static int imx_ocotp_write(void *context, unsigned int offset, void *val,
+static int imx_ocotp_write(void *context, unsigned int offset, const void *val,
size_t bytes)
{
struct ocotp_priv *priv = context;
- u32 *buf = val;
+ const u32 *buf = val;
int ret;
u32 ctrl;
@@ -140,10 +140,10 @@ static int lan9662_otp_read(void *context, unsigned int offset,
}
static int lan9662_otp_write(void *context, unsigned int offset,
- void *_val, size_t bytes)
+ const void *_val, size_t bytes)
{
struct lan9662_otp *otp = context;
- u8 *val = _val;
+ const u8 *val = _val;
u8 data, newdata;
int i, rc = 0;
@@ -87,7 +87,7 @@ static int lpc18xx_eeprom_busywait_until_prog(struct lpc18xx_eeprom_dev *eeprom)
}
static int lpc18xx_eeprom_gather_write(void *context, unsigned int reg,
- void *val, size_t bytes)
+ const void *val, size_t bytes)
{
struct lpc18xx_eeprom_dev *eeprom = context;
unsigned int offset = reg;
@@ -109,7 +109,7 @@ static int lpc18xx_eeprom_gather_write(void *context, unsigned int reg,
usleep_range(100, 200);
while (bytes) {
- writel(*(u32 *)val, eeprom->mem_base + offset);
+ writel(*(const u32 *)val, eeprom->mem_base + offset);
ret = lpc18xx_eeprom_busywait_until_prog(eeprom);
if (ret < 0)
return ret;
@@ -59,7 +59,7 @@ static int max77759_nvmem_reg_read(void *priv, unsigned int offset,
}
static int max77759_nvmem_reg_write(void *priv, unsigned int offset,
- void *val, size_t bytes)
+ const void *val, size_t bytes)
{
struct max77759_nvmem *nvmem = priv;
DEFINE_FLEX(struct max77759_maxq_command, cmd, cmd, length,
@@ -27,12 +27,12 @@ static int meson_efuse_read(void *context, unsigned int offset,
}
static int meson_efuse_write(void *context, unsigned int offset,
- void *val, size_t bytes)
+ const void *val, size_t bytes)
{
struct meson_sm_firmware *fw = context;
int ret;
- ret = meson_sm_call_write(fw, (u8 *)val, bytes, SM_EFUSE_WRITE, offset,
+ ret = meson_sm_call_write(fw, val, bytes, SM_EFUSE_WRITE, offset,
bytes, 0, 0, 0);
return ret < 0 ? ret : 0;
@@ -81,7 +81,7 @@ static int sdam_read(void *priv, unsigned int offset, void *val,
return rc;
}
-static int sdam_write(void *priv, unsigned int offset, void *val,
+static int sdam_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
struct sdam_chip *sdam = priv;
@@ -252,13 +252,13 @@ static int qfprom_enable_fuse_blowing(const struct qfprom_priv *priv,
*
* Return: 0 or -err.
*/
-static int qfprom_reg_write(void *context, unsigned int reg, void *_val,
+static int qfprom_reg_write(void *context, unsigned int reg, void void *_val,
size_t bytes)
{
struct qfprom_priv *priv = context;
struct qfprom_touched_values old;
int words = bytes / 4;
- u32 *value = _val;
+ const u32 *value = _val;
u32 blow_status;
int ret;
int i;
@@ -278,10 +278,10 @@ static int rave_sp_eeprom_reg_read(void *eeprom, unsigned int offset,
}
static int rave_sp_eeprom_reg_write(void *eeprom, unsigned int offset,
- void *val, size_t bytes)
+ const void *val, size_t bytes)
{
return rave_sp_eeprom_access(eeprom, RAVE_SP_EEPROM_WRITE,
- offset, val, bytes);
+ offset, (void *)val, bytes);
}
static int rave_sp_eeprom_probe(struct platform_device *pdev)
@@ -50,7 +50,7 @@ static const struct snvs_lpgpr_cfg snvs_lpgpr_cfg_imx7d = {
.size = 16,
};
-static int snvs_lpgpr_write(void *context, unsigned int offset, void *val,
+static int snvs_lpgpr_write(void *context, unsigned int offset, const void *val,
size_t bytes)
{
struct snvs_lpgpr_priv *priv = context;
@@ -192,7 +192,7 @@ static void sprd_efuse_set_prog_en(struct sprd_efuse *efuse, bool en)
}
static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
- bool lock, u32 *data)
+ bool lock, const u32 *data)
{
u32 status;
int ret = 0;
@@ -321,7 +321,7 @@ static int sprd_efuse_read(void *context, u32 offset, void *val, size_t bytes)
return ret;
}
-static int sprd_efuse_write(void *context, u32 offset, void *val, size_t bytes)
+static int sprd_efuse_write(void *context, u32 offset, const void *val, size_t bytes)
{
struct sprd_efuse *efuse = context;
bool blk_double = efuse->data->blk_double;
@@ -203,7 +203,7 @@ int stm32_bsec_optee_ta_read(struct tee_context *ctx, unsigned int offset,
/* stm32_bsec_optee_ta_write() - nvmem write access using PTA client driver */
int stm32_bsec_optee_ta_write(struct tee_context *ctx, unsigned int lower,
- unsigned int offset, void *buf, size_t bytes)
+ unsigned int offset, const void *buf, size_t bytes)
{ struct tee_shm *shm;
struct tee_ioctl_invoke_arg arg;
struct tee_param param[2];
@@ -50,7 +50,7 @@ int stm32_bsec_optee_ta_read(struct tee_context *ctx, unsigned int offset,
* On success, 0. On failure, -errno.
*/
int stm32_bsec_optee_ta_write(struct tee_context *ctx, unsigned int lower,
- unsigned int offset, void *buf, size_t bytes);
+ unsigned int offset, const void *buf, size_t bytes);
#else
@@ -72,7 +72,7 @@ static inline int stm32_bsec_optee_ta_read(struct tee_context *ctx,
static inline int stm32_bsec_optee_ta_write(struct tee_context *ctx,
unsigned int lower,
- unsigned int offset, void *buf,
+ unsigned int offset, const void *buf,
size_t bytes)
{
return -EOPNOTSUPP;
@@ -118,12 +118,12 @@ static int stm32_bsec_read(void *context, unsigned int offset, void *buf,
return 0;
}
-static int stm32_bsec_write(void *context, unsigned int offset, void *buf,
+static int stm32_bsec_write(void *context, unsigned int offset, const void *buf,
size_t bytes)
{
struct stm32_romem_priv *priv = context;
struct device *dev = priv->cfg.dev;
- u32 *buf32 = buf;
+ const u32 *buf32 = buf;
int ret, i;
/* Allow only writing complete 32-bits aligned words */
@@ -153,7 +153,7 @@ static int stm32_bsec_pta_read(void *context, unsigned int offset, void *buf,
return stm32_bsec_optee_ta_read(priv->ctx, offset, buf, bytes);
}
-static int stm32_bsec_pta_write(void *context, unsigned int offset, void *buf,
+static int stm32_bsec_pta_write(void *context, unsigned int offset, const void *buf,
size_t bytes)
{
struct stm32_romem_priv *priv = context;
@@ -183,7 +183,7 @@ static int zynqmp_nvmem_read(void *context, unsigned int offset, void *val, size
}
static int zynqmp_nvmem_write(void *context,
- unsigned int offset, void *val, size_t bytes)
+ unsigned int offset, const void *val, size_t bytes)
{
int pufflag = 0;
@@ -194,7 +194,7 @@ static int zynqmp_nvmem_write(void *context,
pufflag = 1;
return zynqmp_efuse_access(context, offset,
- val, bytes, EFUSE_WRITE, pufflag);
+ (void *)val, bytes, EFUSE_WRITE, pufflag);
}
static const struct of_device_id zynqmp_nvmem_match[] = {