linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] Input: qt2160 - tweak check for i2c adapter functionality
@ 2023-07-24  5:13 Dmitry Torokhov
  2023-07-24  5:13 ` [PATCH 2/4] Input: qt2160 - switch to using threaded interrupt handler Dmitry Torokhov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2023-07-24  5:13 UTC (permalink / raw)
  To: linux-input; +Cc: Yangtao Li, linux-kernel

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

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/keyboard/qt2160.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c
index 599ea85cfd30..b0b9d7a2691e 100644
--- a/drivers/input/keyboard/qt2160.c
+++ b/drivers/input/keyboard/qt2160.c
@@ -345,12 +345,9 @@ static int qt2160_probe(struct i2c_client *client)
 	int i;
 	int error;
 
-	/* Check functionality */
-	error = i2c_check_functionality(client->adapter,
-			I2C_FUNC_SMBUS_BYTE);
-	if (!error) {
+	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE)) {
 		dev_err(&client->dev, "%s adapter not supported\n",
-				dev_driver_string(&client->adapter->dev));
+			dev_driver_string(&client->adapter->dev));
 		return -ENODEV;
 	}
 
-- 
2.41.0.487.g6d72f3e995-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-24  5:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24  5:13 [PATCH 1/4] Input: qt2160 - tweak check for i2c adapter functionality Dmitry Torokhov
2023-07-24  5:13 ` [PATCH 2/4] Input: qt2160 - switch to using threaded interrupt handler Dmitry Torokhov
2023-07-24  5:13 ` [PATCH 3/4] Input: qt2160 - do not hard code interrupt trigger Dmitry Torokhov
2023-07-24  5:13 ` [PATCH 4/4] Input: qt2160 - convert to use devm_* api Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).