]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: core: improve return value handling of i2c_new_device and i2c_new_dummy
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 16 May 2019 21:13:08 +0000 (23:13 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 17 May 2019 17:28:31 +0000 (19:28 +0200)
commit5fadfb336f1110f3a2822cb64a49b50a40626b95
treeb6ec458fe3934e5dea9bf9345e49a26bd4c7e22d
parent95355e7ba59df93e6a1bcaec1701169bbdc894f1
i2c: core: improve return value handling of i2c_new_device and i2c_new_dummy

Currently i2c_new_device and i2c_new_dummy return just NULL in error
case although they have more error details internally. Therefore move
the functionality into new functions returning detailed errors and
add wrappers for compatibility with the current API.

This allows to use these functions with detailed error codes within
the i2c core or for API extensions.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
[wsa: rename new functions and fix minor kdoc issues]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core-base.c