[PATCH] Input: adxl34x - Drop redundant error variable in adxl34x_i2c_probe

From: Thorsten Blum

Date: Sun Feb 22 2026 - 19:03:47 EST


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@xxxxxxxxx>
---
drivers/input/misc/adxl34x-i2c.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/input/misc/adxl34x-i2c.c b/drivers/input/misc/adxl34x-i2c.c
index c05d898898e8..5ea0ce42a507 100644
--- a/drivers/input/misc/adxl34x-i2c.c
+++ b/drivers/input/misc/adxl34x-i2c.c
@@ -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;
}
--
Thorsten Blum <thorsten.blum@xxxxxxxxx>
GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4