Skip to contentSkip to conversation

Input: adxl34x - Drop redundant error variable in adxl34x_i2c_probe

PATCH Applied Thorsten Blum 2 participants 2 messages Feb 23

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

PATCH 1/1 Input: adxl34x - Drop redundant error variable in adxl34x_i2c_probe

Inline i2c_check_functionality(), which really returns a bool and not an error code, and remove the local variable. No functional changes.

---
 drivers/input/misc/adxl34x-i2c.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/input/misc/adxl34x-i2c.c +1 -4
index c05d898898e8..5ea0ce42a507 100644
@@ -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;
 	}
Signature · 2 lines
Thorsten Blum <[email protected]>
GPG: 1D60 735E 8AEF 3BE4 73B6  9D84 7336 78FD 8DFE EAD4
maintainer Applied
#1 lore raw
Quoted 4 lines · Thorsten Blum

Inline i2c_check_functionality(), which really returns a bool and not an error code, and remove the local variable. No functional changes.

Applied, thank you.

Signature · 1 line
Dmitry