From: Rosalie Wanders <rosalie@mailbox.org>
To: Jiri Kosina <jikos@kernel.org>, Benjamin Tissoires <bentiss@kernel.org>
Cc: Rosalie Wanders <rosalie@mailbox.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] HID: sony: use input_dev from sc struct in sony_init_ff()
Date: Sat, 11 Apr 2026 17:53:47 +0200 [thread overview]
Message-ID: <20260411155347.101760-2-rosalie@mailbox.org> (raw)
This commit makes sony_init_ff() use the input_dev from the sc struct,
this simplifies the sony_init_ff() function.
Signed-off-by: Rosalie Wanders <rosalie@mailbox.org>
---
drivers/hid/hid-sony.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 6a860b9ef677..ad394ac57fa5 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -1853,18 +1853,8 @@ static int sony_play_effect(struct input_dev *dev, void *data,
static int sony_init_ff(struct sony_sc *sc)
{
- struct hid_input *hidinput;
- struct input_dev *input_dev;
-
- if (list_empty(&sc->hdev->inputs)) {
- hid_err(sc->hdev, "no inputs found\n");
- return -ENODEV;
- }
- hidinput = list_entry(sc->hdev->inputs.next, struct hid_input, list);
- input_dev = hidinput->input;
-
- input_set_capability(input_dev, EV_FF, FF_RUMBLE);
- return input_ff_create_memless(input_dev, NULL, sony_play_effect);
+ input_set_capability(sc->input_dev, EV_FF, FF_RUMBLE);
+ return input_ff_create_memless(sc->input_dev, NULL, sony_play_effect);
}
#else
@@ -2151,6 +2141,8 @@ static int sony_input_configured(struct hid_device *hdev,
int append_dev_id;
int ret;
+ sc->input_dev = hidinput->input;
+
ret = sony_set_device_id(sc);
if (ret < 0) {
hid_err(hdev, "failed to allocate the device id\n");
@@ -2311,7 +2303,6 @@ static int sony_input_configured(struct hid_device *hdev,
goto err_close;
}
- sc->input_dev = hidinput->input;
return 0;
err_close:
hid_hw_close(hdev);
--
2.53.0
reply other threads:[~2026-04-11 15:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260411155347.101760-2-rosalie@mailbox.org \
--to=rosalie@mailbox.org \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.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