===== drivers/i2c/i2c-ibm_iic.c 1.6 vs edited ===== --- 1.6/drivers/i2c/i2c-ibm_iic.c Thu Jan 15 13:24:14 2004 +++ edited/drivers/i2c/i2c-ibm_iic.c Mon Mar 8 14:40:21 2004 @@ -3,7 +3,7 @@ * * Support for the IIC peripheral on IBM PPC 4xx * - * Copyright (c) 2003 Zultys Technologies. + * Copyright (c) 2003, 2004 Zultys Technologies. * Eugene Surovegin or * * Based on original work by @@ -446,6 +446,17 @@ } for (i = 0; i < num; ++i){ if (unlikely(msgs[i].len <= 0)){ + if (num == 1 && !msgs[0].len){ + /* Special case for I2C_SMBUS_QUICK emulation. + * Although this logic is INCORRECT, this is + * what previous driver version did. + * IBM IIC doesn't support 0-length transactions + * (except bit-banging through IICx_DIRECTCNTL). + * --ebs + */ + DBG("%d: zero-length msg kluge\n", dev->idx); + return 0; + } DBG("%d: invalid len %d in msg[%d]\n", dev->idx, msgs[i].len, i); return -EINVAL;