Skip to content

Commit 38566ef

Browse files
anthonytexcarlescufi
authored andcommitted
Driver i2c_imx: changed read and write transmission size type
imx_msg transmission size type is uint32_t: changed imx_read and imx_write signature accordingly. Removed also two unused variables. Signed-off-by: Antonio Tessarolo <[email protected]>
1 parent 0a2456c commit 38566ef

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/i2c/i2c_imx.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct i2c_imx_data {
4848
};
4949

5050
static bool i2c_imx_write(const struct device *dev, uint8_t *txBuffer,
51-
uint8_t txSize)
51+
uint32_t txSize)
5252
{
5353
I2C_Type *base = DEV_BASE(dev);
5454
struct i2c_imx_data *data = DEV_DATA(dev);
@@ -82,7 +82,7 @@ static bool i2c_imx_write(const struct device *dev, uint8_t *txBuffer,
8282
}
8383

8484
static void i2c_imx_read(const struct device *dev, uint8_t *rxBuffer,
85-
uint8_t rxSize)
85+
uint32_t rxSize)
8686
{
8787
I2C_Type *base = DEV_BASE(dev);
8888
struct i2c_imx_data *data = DEV_DATA(dev);
@@ -191,7 +191,6 @@ static int i2c_imx_transfer(const struct device *dev, struct i2c_msg *msgs,
191191
I2C_Type *base = DEV_BASE(dev);
192192
struct i2c_imx_data *data = DEV_DATA(dev);
193193
struct i2c_master_transfer *transfer = &data->transfer;
194-
uint8_t *buf, *buf_end;
195194
uint16_t timeout = UINT16_MAX;
196195
int result = -EIO;
197196

@@ -234,8 +233,6 @@ static int i2c_imx_transfer(const struct device *dev, struct i2c_msg *msgs,
234233

235234
/* Transfer data */
236235
if (msgs->len) {
237-
buf = msgs->buf;
238-
buf_end = buf + msgs->len;
239236
if ((msgs->flags & I2C_MSG_RW_MASK) == I2C_MSG_READ) {
240237
i2c_imx_read(dev, msgs->buf, msgs->len);
241238
} else {

0 commit comments

Comments
 (0)