Skip to content

Commit

Permalink
i2c: cbus-gpio: set atomic transfer callback
Browse files Browse the repository at this point in the history
CBUS transfers have always been atomic, but after commit 63b9698
("i2c: core: introduce callbacks for atomic transfers") we started to see
warnings during e.g. poweroff as the atomic callback is not explicitly set.
Fix that.

Fixes the following WARNING seen during Nokia N810 power down:

[  786.570617] reboot: Power down
[  786.573913] ------------[ cut here ]------------
[  786.578826] WARNING: CPU: 0 PID: 672 at drivers/i2c/i2c-core.h:40 i2c_smbus_xfer+0x100/0x110
[  786.587799] No atomic I2C transfer handler for 'i2c-2'

Fixes: 63b9698 ("i2c: core: introduce callbacks for atomic transfers")
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
  • Loading branch information
Aaro Koskinen authored and Wolfram Sang committed Nov 29, 2021
1 parent d58071a commit b127646
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/i2c/busses/i2c-cbus-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ static u32 cbus_i2c_func(struct i2c_adapter *adapter)
}

static const struct i2c_algorithm cbus_i2c_algo = {
.smbus_xfer = cbus_i2c_smbus_xfer,
.functionality = cbus_i2c_func,
.smbus_xfer = cbus_i2c_smbus_xfer,
.smbus_xfer_atomic = cbus_i2c_smbus_xfer,
.functionality = cbus_i2c_func,
};

static int cbus_i2c_remove(struct platform_device *pdev)
Expand Down

0 comments on commit b127646

Please sign in to comment.