linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] HID: i2c-hid: Fixes "(null)" device name error logs in i2c_hid_parse
@ 2026-07-07  1:54 Ai Chao
  2026-07-07  2:32 ` Doug Anderson
  0 siblings, 1 reply; 4+ messages in thread
From: Ai Chao @ 2026-07-07  1:54 UTC (permalink / raw)
  To: jikos, bentiss, dianders, treapking, kenkinming2002, raoxu,
	superm1
  Cc: linux-input, linux-kernel, Ai Chao

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

Signed-off-by: Ai Chao <aichao@kylinos.cn>
---
change for v2
- Used 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;
 		}
 	}
-- 
2.34.1


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

* Re: [PATCH v2] HID: i2c-hid: Fixes "(null)" device name error logs in i2c_hid_parse
  2026-07-07  1:54 Ai Chao
@ 2026-07-07  2:32 ` Doug Anderson
  0 siblings, 0 replies; 4+ messages in thread
From: Doug Anderson @ 2026-07-07  2:32 UTC (permalink / raw)
  To: Ai Chao
  Cc: jikos, bentiss, treapking, kenkinming2002, raoxu, superm1,
	linux-input, linux-kernel

Hi,

On Mon, Jul 6, 2026 at 6:54 PM Ai Chao <aichao@kylinos.cn> 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
>
> Signed-off-by: Ai Chao <aichao@kylinos.cn>
> ---
> change for v2
> - Used Fixes tag.

Could have fooled me. ;-)

-Doug

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

* Re: Re: [PATCH v2] HID: i2c-hid: Fixes "(null)" device name error logs in i2c_hid_parse
@ 2026-07-10  2:39 Ai Chao
  2026-07-10  4:19 ` Mario Limonciello
  0 siblings, 1 reply; 4+ messages in thread
From: Ai Chao @ 2026-07-10  2:39 UTC (permalink / raw)
  To: jikos, bentiss, dianders, treapking, kenkinming2002, raoxu,
	superm1
  Cc: linux-input, linux-kernel

Hello Doug

"Ai" is my surname, and "Chao" is my given name. My name is Ai Chao, which translates to "Super AI".

> > Before: hid (null): reading report descriptor failed
> > After:  i2c_hid i2c-TPD0001:00: reading report descriptor failed
> >
> > Signed-off-by: Ai Chao <aichao@kylinos.cn>
> > ---
> > change for v2
> > - Used Fixes tag.

> Could have fooled me. ;-)

syslog:
kernel: [    3.815131][ 1] [  T319] i2c_designware HYGO0010:00: timeout in disabling adapter
kernel: [   15.790171][ 1] [  T319] i2c_designware HYGO0010:00: timeout waiting for bus ready
kernel: [   15.998769][ 1] [  T319] i2c reading report descriptor failed retry:49
kernel: [   16.038176][ 1] [  T319] i2c_designware HYGO0010:00: timeout waiting for bus ready
kernel: [   16.246771][ 1] [  T319] i2c reading report descriptor failed retry:50
kernel: [   16.246775][ 1] [  T319] hid (null): reading report descriptor failed
kernel: [   16.246778][ 1] [  T319] i2c_hid i2c-TPD0001:00: can't add hid device: -5
kernel: [   16.246954][ 1] [  T319] i2c_hid: probe of i2c-TPD0001:00 failed with error -5


Thanks,
Ai Chao



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

* Re: [PATCH v2] HID: i2c-hid: Fixes "(null)" device name error logs in i2c_hid_parse
  2026-07-10  2:39 Re: [PATCH v2] HID: i2c-hid: Fixes "(null)" device name error logs in i2c_hid_parse Ai Chao
@ 2026-07-10  4:19 ` Mario Limonciello
  0 siblings, 0 replies; 4+ messages in thread
From: Mario Limonciello @ 2026-07-10  4:19 UTC (permalink / raw)
  To: Ai Chao, jikos, bentiss, dianders, treapking, kenkinming2002,
	raoxu
  Cc: linux-input, linux-kernel

On 7/9/26 21:39, Ai Chao wrote:
> Hello Doug
> 
> "Ai" is my surname, and "Chao" is my given name. My name is Ai Chao, which translates to "Super AI".
> 
>>> Before: hid (null): reading report descriptor failed
>>> After:  i2c_hid i2c-TPD0001:00: reading report descriptor failed
>>>
>>> Signed-off-by: Ai Chao <aichao@kylinos.cn>
>>> ---
>>> change for v2
>>> - Used Fixes tag.
> 
>> Could have fooled me. ;-)
> 
> syslog:
> kernel: [    3.815131][ 1] [  T319] i2c_designware HYGO0010:00: timeout in disabling adapter
> kernel: [   15.790171][ 1] [  T319] i2c_designware HYGO0010:00: timeout waiting for bus ready
> kernel: [   15.998769][ 1] [  T319] i2c reading report descriptor failed retry:49
> kernel: [   16.038176][ 1] [  T319] i2c_designware HYGO0010:00: timeout waiting for bus ready
> kernel: [   16.246771][ 1] [  T319] i2c reading report descriptor failed retry:50
> kernel: [   16.246775][ 1] [  T319] hid (null): reading report descriptor failed
> kernel: [   16.246778][ 1] [  T319] i2c_hid i2c-TPD0001:00: can't add hid device: -5
> kernel: [   16.246954][ 1] [  T319] i2c_hid: probe of i2c-TPD0001:00 failed with error -5
> 
> 
> Thanks,
> Ai Chao
> 
> 

The point was that there is no "Fixes" tag added above your SoB, but you 
mentioned that there was one in your changelist.  Identify the commit 
that you're fixing (use git blame for example) and then add it to the 
commit text above your SoB in the correct format.

# git log -1 --format='Fixes: %h ("%s")' $commit

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

end of thread, other threads:[~2026-07-10  4:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10  2:39 Re: [PATCH v2] HID: i2c-hid: Fixes "(null)" device name error logs in i2c_hid_parse Ai Chao
2026-07-10  4:19 ` Mario Limonciello
  -- strict thread matches above, loose matches on Subject: below --
2026-07-07  1:54 Ai Chao
2026-07-07  2:32 ` Doug Anderson

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).