@@ -733,10 +733,10 @@ static int abx80x_nvmem_read(void *priv, unsigned int offset, void *val,
return abx80x_nvmem_xfer(priv, offset, val, bytes, false);
}
-static int abx80x_nvmem_write(void *priv, unsigned int offset, void *val,
+static int abx80x_nvmem_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
- return abx80x_nvmem_xfer(priv, offset, val, bytes, true);
+ return abx80x_nvmem_xfer(priv, offset, (void *)val, bytes, true);
}
static int abx80x_setup_nvmem(struct abx80x_priv *priv)
@@ -659,7 +659,7 @@ static int cmos_nvram_read(void *priv, unsigned int off, void *val,
return 0;
}
-static int cmos_nvram_write(void *priv, unsigned int off, void *val,
+static int cmos_nvram_write(void *priv, unsigned int off, const void *val,
size_t count)
{
struct cmos_rtc *cmos = priv;
@@ -487,7 +487,7 @@ static irqreturn_t ds1305_irq(int irq, void *p)
*/
static void msg_init(struct spi_message *m, struct spi_transfer *x,
- u8 *addr, size_t count, char *tx, char *rx)
+ u8 *addr, size_t count, const char *tx, char *rx)
{
spi_message_init(m);
memset(x, 0, 2 * sizeof(*x));
@@ -519,7 +519,7 @@ static int ds1305_nvram_read(void *priv, unsigned int off, void *buf,
return spi_sync(spi, &m);
}
-static int ds1305_nvram_write(void *priv, unsigned int off, void *buf,
+static int ds1305_nvram_write(void *priv, unsigned int off, const void *buf,
size_t count)
{
struct ds1305 *ds1305 = priv;
@@ -1285,7 +1285,7 @@ static int ds1307_nvram_read(void *priv, unsigned int offset, void *val,
val, bytes);
}
-static int ds1307_nvram_write(void *priv, unsigned int offset, void *val,
+static int ds1307_nvram_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
struct ds1307 *ds1307 = priv;
@@ -123,7 +123,7 @@ static ssize_t ds1343_store_glitchfilter(struct device *dev,
static DEVICE_ATTR(glitch_filter, S_IRUGO | S_IWUSR, ds1343_show_glitchfilter,
ds1343_store_glitchfilter);
-static int ds1343_nvram_write(void *priv, unsigned int off, void *val,
+static int ds1343_nvram_write(void *priv, unsigned int off, const void *val,
size_t bytes)
{
struct ds1343_priv *ds1343 = priv;
@@ -257,7 +257,7 @@ static int ds1511_nvram_read(void *priv, unsigned int pos, void *buf,
return 0;
}
-static int ds1511_nvram_write(void *priv, unsigned int pos, void *buf,
+static int ds1511_nvram_write(void *priv, unsigned int pos, const void *buf,
size_t size)
{
int i;
@@ -234,13 +234,13 @@ static int ds1553_nvram_read(void *priv, unsigned int pos, void *val,
return 0;
}
-static int ds1553_nvram_write(void *priv, unsigned int pos, void *val,
+static int ds1553_nvram_write(void *priv, unsigned int pos, const void *val,
size_t bytes)
{
struct platform_device *pdev = priv;
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr;
- u8 *buf = val;
+ const u8 *buf = val;
for (; bytes; bytes--)
writeb(*buf++, ioaddr + pos++);
@@ -904,13 +904,13 @@ static int ds1685_nvram_read(void *priv, unsigned int pos, void *val,
return 0;
}
-static int ds1685_nvram_write(void *priv, unsigned int pos, void *val,
+static int ds1685_nvram_write(void *priv, unsigned int pos, const void *val,
size_t size)
{
struct ds1685_priv *rtc = priv;
struct mutex *rtc_mutex = &rtc->dev->ops_lock;
ssize_t count;
- u8 *buf = val;
+ const u8 *buf = val;
int err;
err = mutex_lock_interruptible(rtc_mutex);
@@ -126,12 +126,12 @@ static int ds1742_nvram_read(void *priv, unsigned int pos, void *val,
return 0;
}
-static int ds1742_nvram_write(void *priv, unsigned int pos, void *val,
+static int ds1742_nvram_write(void *priv, unsigned int pos, const void *val,
size_t bytes)
{
struct rtc_plat_data *pdata = priv;
void __iomem *ioaddr = pdata->ioaddr_nvram;
- u8 *buf = val;
+ const u8 *buf = val;
for (; bytes; bytes--)
writeb(*buf++, ioaddr + pos++);
@@ -449,7 +449,7 @@ static int ds3232_nvmem_read(void *priv, unsigned int offset, void *val,
val, bytes);
}
-static int ds3232_nvmem_write(void *priv, unsigned int offset, void *val,
+static int ds3232_nvmem_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
struct regmap *ds3232_regmap = (struct regmap *)priv;
@@ -319,11 +319,11 @@ static int isl12026_nvm_read(void *p, unsigned int offset,
}
static int isl12026_nvm_write(void *p, unsigned int offset,
- void *val, size_t bytes)
+ const void *val, size_t bytes)
{
struct isl12026 *priv = p;
int ret;
- u8 *v = val;
+ const u8 *v = val;
size_t chunk_size, num_written;
u8 payload[ISL12026_PAGESIZE + 2]; /* page + 2 address bytes */
struct i2c_msg msgs[] = {
@@ -799,7 +799,7 @@ static int isl1208_nvmem_read(void *priv, unsigned int off, void *buf,
count);
}
-static int isl1208_nvmem_write(void *priv, unsigned int off, void *buf,
+static int isl1208_nvmem_write(void *priv, unsigned int off, const void *buf,
size_t count)
{
struct isl1208_state *isl1208 = priv;
@@ -316,7 +316,7 @@ static int m48t59_nvram_read(void *priv, unsigned int offset, void *val,
return 0;
}
-static int m48t59_nvram_write(void *priv, unsigned int offset, void *val,
+static int m48t59_nvram_write(void *priv, unsigned int offset, const void *val,
size_t size)
{
struct platform_device *pdev = priv;
@@ -325,7 +325,7 @@ static int m48t59_nvram_write(void *priv, unsigned int offset, void *val,
struct m48t59_private *m48t59 = platform_get_drvdata(pdev);
ssize_t cnt = 0;
unsigned long flags;
- u8 *buf = val;
+ const u8 *buf = val;
spin_lock_irqsave(&m48t59->lock, flags);
@@ -171,7 +171,7 @@ static int m48t86_nvram_read(void *priv, unsigned int off, void *buf,
return 0;
}
-static int m48t86_nvram_write(void *priv, unsigned int off, void *buf,
+static int m48t86_nvram_write(void *priv, unsigned int off, const void *buf,
size_t count)
{
struct device *dev = priv;
@@ -576,7 +576,7 @@ static int max31335_nvmem_reg_read(void *priv, unsigned int offset,
}
static int max31335_nvmem_reg_write(void *priv, unsigned int offset,
- void *val, size_t bytes)
+ const void *val, size_t bytes)
{
struct max31335_data *max31335 = priv;
unsigned int reg = max31335->chip->ram_reg + offset;
@@ -266,7 +266,7 @@ static int meson_rtc_regmem_read(void *context, unsigned int offset,
}
static int meson_rtc_regmem_write(void *context, unsigned int offset,
- void *buf, size_t bytes)
+ const void *buf, size_t bytes)
{
struct meson_rtc *rtc = context;
unsigned int write_offset, write_size;
@@ -699,11 +699,11 @@ static int omap_rtc_scratch_read(void *priv, unsigned int offset, void *_val,
return 0;
}
-static int omap_rtc_scratch_write(void *priv, unsigned int offset, void *_val,
+static int omap_rtc_scratch_write(void *priv, unsigned int offset, const void *_val,
size_t bytes)
{
struct omap_rtc *rtc = priv;
- u32 *val = _val;
+ const u32 *val = _val;
int i;
rtc->type->unlock(rtc);
@@ -460,7 +460,7 @@ static int pcf2127_nvmem_read(void *priv, unsigned int offset,
}
static int pcf2127_nvmem_write(void *priv, unsigned int offset,
- void *val, size_t bytes)
+ const void *val, size_t bytes)
{
struct pcf2127 *pcf2127 = priv;
int ret;
@@ -340,7 +340,7 @@ static int pcf85063_nvmem_read(void *priv, unsigned int offset,
}
static int pcf85063_nvmem_write(void *priv, unsigned int offset,
- void *val, size_t bytes)
+ const void *val, size_t bytes)
{
return regmap_write(priv, PCF85063_REG_RAM, *(u8 *)val);
}
@@ -328,7 +328,7 @@ static int pcf85363_nvram_read(void *priv, unsigned int offset, void *val,
val, bytes);
}
-static int pcf85363_nvram_write(void *priv, unsigned int offset, void *val,
+static int pcf85363_nvram_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
struct pcf85363 *pcf85363 = priv;
@@ -350,7 +350,7 @@ static int pcf85x63_nvram_read(void *priv, unsigned int offset, void *val,
return ret;
}
-static int pcf85x63_nvram_write(void *priv, unsigned int offset, void *val,
+static int pcf85x63_nvram_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
struct pcf85363 *pcf85363 = priv;
@@ -188,11 +188,11 @@ static int rp5c01_nvram_read(void *_priv, unsigned int pos, void *val,
return 0;
}
-static int rp5c01_nvram_write(void *_priv, unsigned int pos, void *val,
+static int rp5c01_nvram_write(void *_priv, unsigned int pos, const void *val,
size_t bytes)
{
struct rp5c01_priv *priv = _priv;
- u8 *buf = val;
+ const u8 *buf = val;
spin_lock_irq(&priv->lock);
@@ -602,7 +602,7 @@ static int rv3028_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
}
}
-static int rv3028_nvram_write(void *priv, unsigned int offset, void *val,
+static int rv3028_nvram_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
return regmap_bulk_write(priv, RV3028_RAM1 + offset, val, bytes);
@@ -614,13 +614,13 @@ static int rv3028_nvram_read(void *priv, unsigned int offset, void *val,
return regmap_bulk_read(priv, RV3028_RAM1 + offset, val, bytes);
}
-static int rv3028_eeprom_write(void *priv, unsigned int offset, void *val,
+static int rv3028_eeprom_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
struct rv3028_data *rv3028 = priv;
u32 status, eerd;
int i, ret;
- u8 *buf = val;
+ const u8 *buf = val;
ret = rv3028_enter_eerd(rv3028, &eerd);
if (ret)
@@ -472,7 +472,7 @@ static int rv3029_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
}
}
-static int rv3029_nvram_write(void *priv, unsigned int offset, void *val,
+static int rv3029_nvram_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
return regmap_bulk_write(priv, RV3029_RAM_PAGE + offset, val, bytes);
@@ -483,7 +483,7 @@ static int rv3032_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
}
}
-static int rv3032_nvram_write(void *priv, unsigned int offset, void *val, size_t bytes)
+static int rv3032_nvram_write(void *priv, unsigned int offset, const void *val, size_t bytes)
{
return regmap_bulk_write(priv, RV3032_RAM1 + offset, val, bytes);
}
@@ -493,7 +493,7 @@ static int rv3032_nvram_read(void *priv, unsigned int offset, void *val, size_t
return regmap_bulk_read(priv, RV3032_RAM1 + offset, val, bytes);
}
-static int rv3032_eeprom_write(void *priv, unsigned int offset, void *val, size_t bytes)
+static int rv3032_eeprom_write(void *priv, unsigned int offset, const void *val, size_t bytes)
{
struct rv3032_data *rv3032 = priv;
u32 status, eerd;
@@ -536,10 +536,10 @@ static int rv8803_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
}
}
-static int rv8803_nvram_write(void *priv, unsigned int offset, void *val,
+static int rv8803_nvram_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
- return rv8803_write_reg(priv, RV8803_RAM, *(u8 *)val);
+ return rv8803_write_reg(priv, RV8803_RAM, *(const u8 *)val);
}
static int rv8803_nvram_read(void *priv, unsigned int offset,
@@ -188,7 +188,7 @@ static int rx8571_nvram_read(void *priv, unsigned int offset, void *val,
return regmap_bulk_read(regmap, RX8571_USER_RAM + offset, val, bytes);
}
-static int rx8571_nvram_write(void *priv, unsigned int offset, void *val,
+static int rx8571_nvram_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
struct regmap *regmap = priv;
@@ -209,7 +209,7 @@ static int rx85x1_nvram_read(void *priv, unsigned int offset, void *val,
return ret;
}
-static int rx85x1_nvram_write(void *priv, unsigned int offset, void *val,
+static int rx85x1_nvram_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
struct regmap *regmap = priv;
@@ -67,7 +67,7 @@ struct s35390a {
int twentyfourhour;
};
-static int s35390a_set_reg(struct s35390a *s35390a, int reg, u8 *buf, int len)
+static int s35390a_set_reg(struct s35390a *s35390a, int reg, const u8 *buf, int len)
{
struct i2c_client *client = s35390a->client[reg];
struct i2c_msg msg[] = {
@@ -426,7 +426,7 @@ static int s35390a_nvmem_read(void *priv, unsigned int offset, void *val,
return s35390a_get_reg(s35390a, S35390A_CMD_FREE_REG, val, bytes);
}
-static int s35390a_nvmem_write(void *priv, unsigned int offset, void *val,
+static int s35390a_nvmem_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
struct s35390a *s35390a = priv;
@@ -242,12 +242,12 @@ static int stk17ta8_nvram_read(void *priv, unsigned int pos, void *val,
return 0;
}
-static int stk17ta8_nvram_write(void *priv, unsigned int pos, void *val,
+static int stk17ta8_nvram_write(void *priv, unsigned int pos, const void *val,
size_t bytes)
{
struct rtc_plat_data *pdata = priv;
void __iomem *ioaddr = pdata->ioaddr;
- u8 *buf = val;
+ const u8 *buf = val;
for (; bytes; bytes--)
writeb(*buf++, ioaddr + pos++);
@@ -688,10 +688,10 @@ static int sun6i_rtc_nvmem_read(void *priv, unsigned int offset, void *_val, siz
return 0;
}
-static int sun6i_rtc_nvmem_write(void *priv, unsigned int offset, void *_val, size_t bytes)
+static int sun6i_rtc_nvmem_write(void *priv, unsigned int offset, const void *_val, size_t bytes)
{
struct sun6i_rtc_dev *chip = priv;
- u32 *val = _val;
+ const u32 *val = _val;
int i;
for (i = 0; i < bytes / 4; ++i)
@@ -491,7 +491,7 @@ static int ti_k3_rtc_scratch_read(void *priv_data, unsigned int offset,
}
static int ti_k3_rtc_scratch_write(void *priv_data, unsigned int offset,
- void *val, size_t bytes)
+ const void *val, size_t bytes)
{
struct ti_k3_rtc *priv = (struct ti_k3_rtc *)priv_data;
int ret;
@@ -493,7 +493,7 @@ static int twl_nvram_read(void *priv, unsigned int offset, void *val,
return twl_i2c_read((long)priv, val, offset, bytes);
}
-static int twl_nvram_write(void *priv, unsigned int offset, void *val,
+static int twl_nvram_write(void *priv, unsigned int offset, const void *val,
size_t bytes)
{
return twl_i2c_write((long)priv, val, offset, bytes);