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

Thorsten Blum posted 1 patch 1 month, 3 weeks ago
drivers/input/misc/adxl34x-i2c.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH] Input: adxl34x - Drop redundant error variable in adxl34x_i2c_probe
Posted by Thorsten Blum 1 month, 3 weeks ago
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>
---
 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@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4
Re: [PATCH] Input: adxl34x - Drop redundant error variable in adxl34x_i2c_probe
Posted by Dmitry Torokhov 1 month, 3 weeks ago
On Mon, Feb 23, 2026 at 01:03:04AM +0100, Thorsten Blum wrote:
> 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>

Applied, thank you.

-- 
Dmitry