From: Simon Glass Date: Mon, 20 Apr 2015 18:37:13 +0000 (-0600) Subject: dm: i2c: sandbox: Add debugging to the speed limit X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=1bde67b1f492cbb0177241a56af59f706d45fccf;p=u-boot.git dm: i2c: sandbox: Add debugging to the speed limit Print a debug() message with the I2C speed is exceeded. Signed-off-by: Simon Glass Acked-by: Heiko Schocher --- diff --git a/drivers/i2c/sandbox_i2c.c b/drivers/i2c/sandbox_i2c.c index d6adc0f721..621caecf04 100644 --- a/drivers/i2c/sandbox_i2c.c +++ b/drivers/i2c/sandbox_i2c.c @@ -73,8 +73,10 @@ static int sandbox_i2c_xfer(struct udevice *bus, struct i2c_msg *msg, * 400KHz for reads */ is_read = nmsgs > 1; - if (i2c->speed_hz > (is_read ? 400000 : 100000)) + if (i2c->speed_hz > (is_read ? 400000 : 100000)) { + debug("%s: Max speed exceeded\n", __func__); return -EINVAL; + } return ops->xfer(emul, msg, nmsgs); }