Skip to contentSkip to conversation

Input: qt1050 - inline i2c_check_functionality check

PATCH Applied Thorsten Blum 2 participants 3 messages Apr 8

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Input: qt1050 - inline i2c_check_functionality check

Inline the i2c_check_functionality() check, since the function returns a boolean status rather than an error code.

---
 drivers/input/keyboard/qt1050.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/input/keyboard/qt1050.c +1 -2
index bce8157d1871..f9f480c91032 100644
@@ -435,8 +435,7 @@ static int qt1050_probe(struct i2c_client *client)
 	int err;
 
 	/* Check basic functionality */
-	err = i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE);
-	if (!err) {
+	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE)) {
 		dev_err(&client->dev, "%s adapter not supported\n",
 			dev_driver_string(&client->adapter->dev));
 		return -ENODEV;
#1 lore raw

PATCH 2/2 Input: qt1070 - inline i2c_check_functionality check

Inline the i2c_check_functionality() check, since the function returns a boolean status rather than an error code.

---
 drivers/input/keyboard/qt1070.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/input/keyboard/qt1070.c +1 -2
index b3db2c7d0957..b255b997e279 100644
@@ -133,8 +133,7 @@ static int qt1070_probe(struct i2c_client *client)
 	int i;
 	int err;
 
-	err = i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE);
-	if (!err) {
+	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE)) {
 		dev_err(&client->dev, "%s adapter not supported\n",
 			dev_driver_string(&client->adapter->dev));
 		return -ENODEV;