From: Tin Huynh Date: Mon, 22 May 2017 09:19:20 +0000 (+0700) Subject: leds: pca955x: Correct I2C Functionality X-Git-Tag: v3.18.105~85 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be622831649a4223be0d3da88403b6774ab354f0;p=thirdparty%2Fkernel%2Fstable.git leds: pca955x: Correct I2C Functionality [ Upstream commit aace34c0bb8ea3c8bdcec865b6a4be4db0a68e33 ] The driver checks an incorrect flag of functionality of adapter. When a driver requires i2c_smbus_read_byte_data and i2c_smbus_write_byte_data, it should check I2C_FUNC_SMBUS_BYTE_DATA instead I2C_FUNC_I2C. This patch fixes the problem. Signed-off-by: Tin Huynh Signed-off-by: Jacek Anaszewski Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c index c3a08b60535bc..760deffa9ad30 100644 --- a/drivers/leds/leds-pca955x.c +++ b/drivers/leds/leds-pca955x.c @@ -281,7 +281,7 @@ static int pca955x_probe(struct i2c_client *client, "slave address 0x%02x\n", id->name, chip->bits, client->addr); - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -EIO; if (pdata) {