public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: charles.embedded@gmail.com
To: Anshul Dalal <anshulusr@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>,
	Brigham Campbell <me@brighamcampbell.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Charles Dias <charlesdias.cd@outlook.com>
Subject: [PATCH 1/3] Input: adafruit-seesaw - switch to using dev_err_probe()
Date: Sat, 21 Mar 2026 17:24:44 -0300	[thread overview]
Message-ID: <20260321202446.724277-2-charles.embedded@gmail.com> (raw)
In-Reply-To: <20260321202446.724277-1-charles.embedded@gmail.com>

From: Charles Dias <charlesdias.cd@outlook.com>

Use dev_err_probe() instead of dev_err() in seesaw_probe function
to improve error handling.

Signed-off-by: Charles Dias <charlesdias.cd@outlook.com>
---
 drivers/input/joystick/adafruit-seesaw.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/input/joystick/adafruit-seesaw.c b/drivers/input/joystick/adafruit-seesaw.c
index c248c15b849d..177b42446e9b 100644
--- a/drivers/input/joystick/adafruit-seesaw.c
+++ b/drivers/input/joystick/adafruit-seesaw.c
@@ -277,17 +277,12 @@ static int seesaw_probe(struct i2c_client *client)
 			     SEESAW_JOYSTICK_FUZZ, SEESAW_JOYSTICK_FLAT);
 
 	err = sparse_keymap_setup(seesaw->input_dev, seesaw_buttons_new, NULL);
-	if (err) {
-		dev_err(&client->dev,
-			"failed to set up input device keymap: %d\n", err);
-		return err;
-	}
+	if (err)
+		return dev_err_probe(&client->dev, err, "failed to set up input device keymap\n");
 
 	err = input_setup_polling(seesaw->input_dev, seesaw_poll);
-	if (err) {
-		dev_err(&client->dev, "failed to set up polling: %d\n", err);
-		return err;
-	}
+	if (err)
+		return dev_err_probe(&client->dev, err, "failed to set up polling\n");
 
 	input_set_poll_interval(seesaw->input_dev,
 				SEESAW_GAMEPAD_POLL_INTERVAL_MS);
@@ -295,10 +290,8 @@ static int seesaw_probe(struct i2c_client *client)
 	input_set_min_poll_interval(seesaw->input_dev, SEESAW_GAMEPAD_POLL_MIN);
 
 	err = input_register_device(seesaw->input_dev);
-	if (err) {
-		dev_err(&client->dev, "failed to register joystick: %d\n", err);
-		return err;
-	}
+	if (err)
+		return dev_err_probe(&client->dev, err, "failed to register joystick\n");
 
 	return 0;
 }

  reply	other threads:[~2026-03-21 20:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-21 20:24 [PATCH 0/3] Input: adafruit-seesaw: use dev_err_probe and add IRQ support charles.embedded
2026-03-21 20:24 ` charles.embedded [this message]
2026-03-21 20:24 ` [PATCH 2/3] Input: adafruit-seesaw - add interrupt support charles.embedded
2026-03-23  5:12   ` Dmitry Torokhov
2026-03-24 13:59     ` Charles Dias
2026-03-21 20:24 ` [PATCH 3/3] dt-bindings: input: adafruit-seesaw-gamepad: fix interrupt polarity charles.embedded

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260321202446.724277-2-charles.embedded@gmail.com \
    --to=charles.embedded@gmail.com \
    --cc=anshulusr@gmail.com \
    --cc=charlesdias.cd@outlook.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@brighamcampbell.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox