If we get a msg.reply of REPLY_DEFER, we also get an err of 0
so we fail reads with 0 < size and return -EPROTO instead of trying
again.
v2: same fix in i2c code.
Found writing MST support.
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
return err;
}
- if (err < size)
- return -EPROTO;
switch (msg.reply & DP_AUX_NATIVE_REPLY_MASK) {
case DP_AUX_NATIVE_REPLY_ACK:
+ if (err < size)
+ return -EPROTO;
return err;
case DP_AUX_NATIVE_REPLY_NACK:
return err;
}
- if (err < msg->size)
- return -EPROTO;
switch (msg->reply & DP_AUX_NATIVE_REPLY_MASK) {
case DP_AUX_NATIVE_REPLY_ACK:
* Both native ACK and I2C ACK replies received. We
* can assume the transfer was successful.
*/
+ if (err < msg->size)
+ return -EPROTO;
return 0;
case DP_AUX_I2C_REPLY_NACK: