Skip to content

Commit bce9c6e

Browse files
aaronemasseycarlescufi
authored andcommitted
emul_sbs_gauge: Rename reg_read/write more unique
Rename the reg_read and reg_write functions in the emul_sbs_gauge emulator to be more unique symbols so as to support overriding this specific function in future tests that make use of FFF. See zephyrproject-rtos#46817 which includes a test for error reads as an example. Signed-off-by: Aaron Massey <aaronmassey@google.com>
1 parent 1d8750d commit bce9c6e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

subsys/emul/i2c/emul_sbs_gauge.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct sbs_gauge_emul_cfg {
3131
uint16_t addr;
3232
};
3333

34-
static int reg_write(const struct emul *target, int reg, int val)
34+
static int emul_sbs_gauge_reg_write(const struct emul *target, int reg, int val)
3535
{
3636
ARG_UNUSED(target);
3737

@@ -45,7 +45,7 @@ static int reg_write(const struct emul *target, int reg, int val)
4545
return 0;
4646
}
4747

48-
static int reg_read(const struct emul *target, int reg, int *val)
48+
static int emul_sbs_gauge_reg_read(const struct emul *target, int reg, int *val)
4949
{
5050
ARG_UNUSED(target);
5151

@@ -104,7 +104,7 @@ static int sbs_gauge_emul_transfer_i2c(const struct emul *target, struct i2c_msg
104104
if (msgs->flags & I2C_MSG_READ) {
105105
switch (msgs->len - 1) {
106106
case 1:
107-
rc = reg_read(target, reg, &val);
107+
rc = emul_sbs_gauge_reg_read(target, reg, &val);
108108
if (rc) {
109109
/* Return before writing bad value to message buffer */
110110
return rc;
@@ -119,7 +119,7 @@ static int sbs_gauge_emul_transfer_i2c(const struct emul *target, struct i2c_msg
119119
if (msgs->len != 1) {
120120
LOG_ERR("Unexpected msg1 length %d", msgs->len);
121121
}
122-
rc = reg_write(target, reg, msgs->buf[0]);
122+
rc = emul_sbs_gauge_reg_write(target, reg, msgs->buf[0]);
123123
}
124124
break;
125125
default:

0 commit comments

Comments
 (0)