Re: [PATCH v2] HID: i2c-hid: Fixes "(null)" device name error logs in i2c_hid_parse

From: Doug Anderson

Date: Mon Jul 06 2026 - 22:33:01 EST


Hi,

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

Could have fooled me. ;-)

-Doug