]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: refactor i2c_master_{send_recv}
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sat, 4 Nov 2017 20:20:04 +0000 (21:20 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Sun, 3 Dec 2017 20:22:29 +0000 (21:22 +0100)
commit75b94918ba4d70a4fd5a2041d25f783c2399daa7
tree326e7f954d0e2200741b0422773af8e8da1c4371
parentf4e86b8123493eb307bff88c30c6915712255552
i2c: refactor i2c_master_{send_recv}

Those two functions are very similar, the only differences are that one
needs the I2C_M_RD flag for its message while the other one needs the
buffer casted to drop the const. Introduce a generic helper which allows
to specify the flags (also needed later for DMA safe variants of these
calls) and let the casting be done in the inlining functions which are
now calling the new helper function.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core-base.c
include/linux/i2c.h