From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757940AbdEVJTn (ORCPT ); Mon, 22 May 2017 05:19:43 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:34152 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757863AbdEVJTj (ORCPT ); Mon, 22 May 2017 05:19:39 -0400 From: Tin Huynh To: Richard Purdie , Jacek Anaszewski , Pavel Machek , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Loc Ho , Phong Vo , Thang Nguyen , patches@apm.com, Tin Huynh Subject: [PATCH V1] leds: pca955x: Correct I2C Functionality Date: Mon, 22 May 2017 16:19:20 +0700 Message-Id: <1495444760-7626-1-git-send-email-tnhuynh@apm.com> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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