Unverified Commit bd941dfa authored by Rikard Falkeborn's avatar Rikard Falkeborn Committed by Mark Brown
Browse files

regmap: Constify static regmap_bus structs



The only usage of these is to pass their address to __regmap_init() or
__devm_regmap_init(), both which takes pointers to const struct
regmap_bus. Make them const to allow the compiler to put them in
read-only memory.

Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20220330214110.36337-1-rikard.falkeborn@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 31231092
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ static int regmap_i3c_read(void *context,
	return i3c_device_do_priv_xfers(i3c, xfers, 2);
}

static struct regmap_bus regmap_i3c = {
static const struct regmap_bus regmap_i3c = {
	.write = regmap_i3c_write,
	.read = regmap_i3c_read,
};
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ static int regmap_sccb_write(void *context, unsigned int reg, unsigned int val)
	return i2c_smbus_write_byte_data(i2c, reg, val);
}

static struct regmap_bus regmap_sccb_bus = {
static const struct regmap_bus regmap_sccb_bus = {
	.reg_write = regmap_sccb_write,
	.reg_read = regmap_sccb_read,
};
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ static int regmap_sdw_mbq_read(void *context, unsigned int reg, unsigned int *va
	return 0;
}

static struct regmap_bus regmap_sdw_mbq = {
static const struct regmap_bus regmap_sdw_mbq = {
	.reg_read = regmap_sdw_mbq_read,
	.reg_write = regmap_sdw_mbq_write,
	.reg_format_endian_default = REGMAP_ENDIAN_LITTLE,
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ static int regmap_sdw_read(void *context, unsigned int reg, unsigned int *val)
	return 0;
}

static struct regmap_bus regmap_sdw = {
static const struct regmap_bus regmap_sdw = {
	.reg_read = regmap_sdw_read,
	.reg_write = regmap_sdw_write,
	.reg_format_endian_default = REGMAP_ENDIAN_LITTLE,
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ static int regmap_slimbus_read(void *context, const void *reg, size_t reg_size,
	return slim_read(sdev, *(u16 *)reg, val_size, val);
}

static struct regmap_bus regmap_slimbus_bus = {
static const struct regmap_bus regmap_slimbus_bus = {
	.write = regmap_slimbus_write,
	.read = regmap_slimbus_read,
	.reg_format_endian_default = REGMAP_ENDIAN_LITTLE,
Loading