* [PATCH V1] leds: pca955x: Correct I2C Functionality
@ 2017-05-22 9:19 Tin Huynh
2017-05-22 19:02 ` Jacek Anaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Tin Huynh @ 2017-05-22 9:19 UTC (permalink / raw)
To: Richard Purdie, Jacek Anaszewski, Pavel Machek, linux-leds, linux-kernel
Cc: Loc Ho, Phong Vo, Thang Nguyen, patches, Tin Huynh
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>
---
drivers/leds/leds-pca955x.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c
index 78a7ce8..9a87311 100644
--- a/drivers/leds/leds-pca955x.c
+++ b/drivers/leds/leds-pca955x.c
@@ -285,7 +285,7 @@ static int pca955x_probe(struct i2c_client *client,
"slave address 0x%02x\n",
client->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) {
--
1.7.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH V1] leds: pca955x: Correct I2C Functionality
2017-05-22 9:19 [PATCH V1] leds: pca955x: Correct I2C Functionality Tin Huynh
@ 2017-05-22 19:02 ` Jacek Anaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Jacek Anaszewski @ 2017-05-22 19:02 UTC (permalink / raw)
To: Tin Huynh, Richard Purdie, Pavel Machek, linux-leds, linux-kernel
Cc: Loc Ho, Phong Vo, Thang Nguyen, patches
Hi Tin,
On 05/22/2017 11:19 AM, Tin Huynh wrote:
> 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>
> ---
> drivers/leds/leds-pca955x.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c
> index 78a7ce8..9a87311 100644
> --- a/drivers/leds/leds-pca955x.c
> +++ b/drivers/leds/leds-pca955x.c
> @@ -285,7 +285,7 @@ static int pca955x_probe(struct i2c_client *client,
> "slave address 0x%02x\n",
> client->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) {
>
Applied to the fixes-for-4.12rc3 branch of linux-leds.git, thanks.
--
Best regards,
Jacek Anaszewski
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-22 19:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 9:19 [PATCH V1] leds: pca955x: Correct I2C Functionality Tin Huynh
2017-05-22 19:02 ` Jacek Anaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®