From: Mario Limonciello <superm1@kernel.org>
To: Ai Chao <aichao@kylinos.cn>,
jikos@kernel.org, bentiss@kernel.org, dianders@chromium.org,
treapking@chromium.org, kenkinming2002@gmail.com,
raoxu@uniontech.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] HID: i2c-hid: Fix "(null)" output when reading report descriptor fails
Date: Thu, 16 Jul 2026 08:50:24 -0500 [thread overview]
Message-ID: <2d193a9f-dd0c-409e-982d-d60d4d64128d@kernel.org> (raw)
In-Reply-To: <20260716112932.4038146-1-aichao@kylinos.cn>
On 7/16/26 06:29, Ai Chao wrote:
> When i2c-hid fails to read the HID report descriptor during device
> initialization, the error message prints as:
>
> hid (null): reading report descriptor failed
>
> The HID device name is set in hid_add_device() after calling
> hdev->ll_driver->parse(), so when i2c_hid_parse() fails and calls
> hid_err(), the device name has not been set yet, resulting in "(null)"
> output.
>
> Use dev_err(&client->dev, ...) instead of hid_err(hid, ...) because
> the I2C client device is fully initialized with a proper name, providing
> meaningful error messages for debugging.
>
> Before: hid (null): reading report descriptor failed
> After: i2c_hid i2c-TPD0001:00: reading report descriptor failed
>
> Fixes: 4a200c3b9a40 ("HID: i2c-hid: introduce HID over i2c specification implementation")
>
> Signed-off-by: Ai Chao <aichao@kylinos.cn>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> change for v4
> - Add Fixes tag.
> ---
> drivers/hid/i2c-hid/i2c-hid-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
> index 3adb16366e93..0e725a0f0abe 100644
> --- a/drivers/hid/i2c-hid/i2c-hid-core.c
> +++ b/drivers/hid/i2c-hid/i2c-hid-core.c
> @@ -792,7 +792,7 @@ static int i2c_hid_parse(struct hid_device *hid)
> ihid->hdesc.wReportDescRegister,
> rdesc, rsize);
> if (ret) {
> - hid_err(hid, "reading report descriptor failed\n");
> + dev_err(&client->dev, "reading report descriptor failed\n");
> goto out;
> }
> }
prev parent reply other threads:[~2026-07-16 13:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 11:29 [PATCH v4] HID: i2c-hid: Fix "(null)" output when reading report descriptor fails Ai Chao
2026-07-16 13:50 ` Mario Limonciello [this message]
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=2d193a9f-dd0c-409e-982d-d60d4d64128d@kernel.org \
--to=superm1@kernel.org \
--cc=aichao@kylinos.cn \
--cc=bentiss@kernel.org \
--cc=dianders@chromium.org \
--cc=jikos@kernel.org \
--cc=kenkinming2002@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=raoxu@uniontech.com \
--cc=treapking@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.