From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C25DE311C1D; Tue, 7 Jul 2026 01:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783389297; cv=none; b=bmPfo90dGIFT8WprDRsW2+xXb9NpL38wTj3Rb729daaqy8J4WNWEC2n/er3tOQANHu2wbPJuRcyAxEOTw5IhlhKaWCvjMNlGXIXWrNV3vIptsjfZhHqA1CVxUJTuizlJLR/NNZyGtGdl2kxjIeyDWJRVA4iQ/aOOVQBPyOUJMaA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783389297; c=relaxed/simple; bh=nCEQYZWuNoeRtdaSv+HcuR4AmfLZT8zknXGGqoDR88A=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=JB7SD/qFpaal/7QOsrbrrs7DGZVKq4jy6wkAx5ex6naTlqmG6r6p+MpOgtWqlGFy6+VBUYKQfagfJgsC0Rz/LnEOH2nVyD926WsmeCV+boNIjIEIWlOR4sG0/TGBtoTVO0e1o/w9ULdRPqXoFvkWxQeauhT4yPIyNxTL3UyJmpc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: d4c22b2a79a611f1aa26b74ffac11d73-20260707 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:c7d990f5-8215-4e92-9695-dd47a57805bd,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:e7bac3a,CLOUDID:a314f96c8327d83dbd5e12ec2fec5405,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|136|865|898,TC:nil,Content:0|15|50,E DM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA :0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: d4c22b2a79a611f1aa26b74ffac11d73-20260707 X-User: aichao@kylinos.cn Received: from thinksys.. [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 83989527; Tue, 07 Jul 2026 09:54:46 +0800 From: Ai Chao To: jikos@kernel.org, bentiss@kernel.org, dianders@chromium.org, treapking@chromium.org, kenkinming2002@gmail.com, raoxu@uniontech.com, superm1@kernel.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Ai Chao Subject: [PATCH v2] HID: i2c-hid: Fixes "(null)" device name error logs in i2c_hid_parse Date: Tue, 7 Jul 2026 09:54:23 +0800 Message-Id: <20260707015423.3944655-1-aichao@kylinos.cn> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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