summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTin Huynh <tnhuynh@apm.com>2017-05-22 16:19:20 +0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-13 19:48:03 +0200
commit1a53869c4c3406d841093c8e5e0649e5f6de80ac (patch)
treebc9e045cfad2a8013c104c6a48422899c365ca1c
parent69f4dd14771cad36c38640ff3f5c537bc6b97762 (diff)
downloadlinux-stable-1a53869c4c3406d841093c8e5e0649e5f6de80ac.tar.gz
linux-stable-1a53869c4c3406d841093c8e5e0649e5f6de80ac.tar.bz2
linux-stable-1a53869c4c3406d841093c8e5e0649e5f6de80ac.zip
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 <tnhuynh@apm.com> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/leds/leds-pca955x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c
index 840401ae9a4e..f6726484a8a1 100644
--- a/drivers/leds/leds-pca955x.c
+++ b/drivers/leds/leds-pca955x.c
@@ -266,7 +266,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) {