From b8f5fe3bc5b9318d95770a09a480c31aced20cd2 Mon Sep 17 00:00:00 2001 From: Heiner Kallweit Date: Thu, 16 May 2019 23:13:09 +0200 Subject: i2c: core: add device-managed version of i2c_new_dummy i2c_new_dummy is typically called from the probe function of the driver for the primary i2c client. It requires calls to i2c_unregister_device in the error path of the probe function and in the remove function. This can be simplified by introducing a device-managed version. Note the changed error case return value type: i2c_new_dummy returns NULL whilst devm_i2c_new_dummy_device returns an ERR_PTR. Signed-off-by: Heiner Kallweit [wsa: rename new functions and fix minor kdoc issues] Signed-off-by: Wolfram Sang Reviewed-by: Peter Rosin Reviewed-by: Kieran Bingham Reviewed-by: Bartosz Golaszewski Signed-off-by: Wolfram Sang --- Documentation/driver-model/devres.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation') diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index 99994a461359..69c7fa7f616c 100644 --- a/Documentation/driver-model/devres.txt +++ b/Documentation/driver-model/devres.txt @@ -271,6 +271,9 @@ GPIO devm_gpio_request_one() devm_gpio_free() +I2C + devm_i2c_new_dummy_device() + IIO devm_iio_device_alloc() devm_iio_device_free() -- cgit v1.2.3-58-ga151