summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-11-15 14:21:13 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-11-15 14:21:13 +0100
commit42cdd1452a51ca970a6cda76e3bdbe4f04d6e13f (patch)
treee977baadd93fd72759c1c0b96aee77090950b39b /drivers/i2c
parent71f347dadfd9d19b57c4bda1ff446add38081e92 (diff)
parentf1d33492703334c6a8c813c4af546a1d6d87c385 (diff)
downloadbarebox-42cdd1452a51ca970a6cda76e3bdbe4f04d6e13f.tar.gz
Merge branch 'for-next/misc'
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c.c3
-rw-r--r--drivers/i2c/muxes/i2c-mux-pca954x.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index 12aac42794..125322406a 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -215,7 +215,8 @@ int i2c_write_reg(struct i2c_client *client, u32 addr, const u8 *buf, u16 count)
msgbuf[i++] = addr;
msg->len += i;
- memcpy(msg->buf + i, buf, count);
+ if (count)
+ memcpy(msg->buf + i, buf, count);
status = i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg));
dev_dbg(&client->adapter->dev, "%s: %u@%u --> %d\n", __func__,
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index aa7dcb8c31..0b397185c9 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -210,10 +210,8 @@ static int pca954x_probe(struct device_d *dev)
* that the mux is in fact present. This also
* initializes the mux to disconnected state.
*/
- if (i2c_smbus_write_byte(client, 0) < 0) {
- dev_warn(&client->dev, "probe failed\n");
+ if (i2c_smbus_write_byte(client, 0) < 0)
goto exit_free;
- }
ret = dev_get_drvdata(dev, (const void **)&tmp);
data->type = tmp;