i2c: add extra check to safe DMA buffer helper
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 12 Mar 2019 12:44:42 +0000 (13:44 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 13 Mar 2019 17:03:26 +0000 (18:03 +0100)
commitbf263c35b2ebe7f1674205f6b36487250299b5a7
treed281179a1dfafd96a655cd4234e1238179973113
parentc86da50cfd840edf223a242580913692acddbcf6
i2c: add extra check to safe DMA buffer helper

Make sure we report 'no buffer' for 0-length messages. This can only
happen if threshold is set to 0 which is kind of bogus but we should
still handle this situation. Update the docs and add a debug message
to educate callers of this function.

Reported-by: Hsin-Yi Wang <hsinyi@chromium.org>
Fixes: e94bc5d18be0 ("i2c: add helpers to ease DMA handling")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core-base.c