]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: adxl34x - drop redundant error variable in adxl34x_i2c_probe
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 23 Feb 2026 00:03:04 +0000 (01:03 +0100)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 23 Feb 2026 03:52:22 +0000 (19:52 -0800)
Inline i2c_check_functionality(), which really returns a bool and not an
error code, and remove the local variable.  No functional changes.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260223000308.319335-1-thorsten.blum@linux.dev
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/adxl34x-i2c.c

index c05d898898e842f6ce2e0a06b9a7bcd4aead3a57..5ea0ce42a507455222d3c180d720726a3a232e00 100644 (file)
@@ -77,11 +77,8 @@ static const struct adxl34x_bus_ops adxl34x_i2c_bops = {
 static int adxl34x_i2c_probe(struct i2c_client *client)
 {
        struct adxl34x *ac;
-       int error;
 
-       error = i2c_check_functionality(client->adapter,
-                       I2C_FUNC_SMBUS_BYTE_DATA);
-       if (!error) {
+       if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
                dev_err(&client->dev, "SMBUS Byte Data not Supported\n");
                return -EIO;
        }