Input: qt2160 - tweak check for i2c adapter functionality

i2c_check_functionality() returns essentially a boolean and not an error
code, so treat it as such.

Link: https://lore.kernel.org/r/20230724051345.335219-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Dmitry Torokhov 2023-07-23 22:13:39 -07:00
parent 92e24e0e57
commit f94c3bce74

View File

@ -345,12 +345,9 @@ static int qt2160_probe(struct i2c_client *client)
int i; int i;
int error; int error;
/* Check functionality */ if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE)) {
error = i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_BYTE);
if (!error) {
dev_err(&client->dev, "%s adapter not supported\n", dev_err(&client->dev, "%s adapter not supported\n",
dev_driver_string(&client->adapter->dev)); dev_driver_string(&client->adapter->dev));
return -ENODEV; return -ENODEV;
} }