* [PATCH] HID: intel-thc-hid: intel-quicki2c: Fix the return value in quicki2c_dev_init() kernel-doc
@ 2026-09-12 0:21 Karl Mehltretter
2026-09-12 12:45 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Karl Mehltretter @ 2026-09-12 0:21 UTC (permalink / raw)
To: Even Xu, Xinpeng Sun, Jiri Kosina, Benjamin Tissoires
Cc: Karl Mehltretter, Andy Shevchenko, linux-input, linux-kernel
quicki2c_dev_init() returns an ERR_PTR() on failure, but its kernel-doc
says that failure returns NULL. This mismatch was present in the
original driver skeleton.
Document the error pointer returned by the initialization paths.
Fixes: 61bb2714dc3a ("HID: intel-thc-hid: intel-quicki2c: Add THC QuickI2C driver skeleton")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
index 0d2ad7bc3648a2f227db2ed27ad9cbe18955bc0f..aa601ef613c91729f4fc90bdc1674cb838921421 100644
--- a/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
+++ b/drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c
@@ -380,7 +380,7 @@ exit:
* If success, enable THC hardware interrupt.
*
* Return: Pointer to the quicki2c_device structure if success
- * or NULL on failure.
+ * or an ERR_PTR() on failure.
*/
static struct quicki2c_device *quicki2c_dev_init(struct pci_dev *pdev, void __iomem *mem_addr,
const struct quicki2c_ddata *ddata)
--
2.39.5 (Apple Git-154)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] HID: intel-thc-hid: intel-quicki2c: Fix the return value in quicki2c_dev_init() kernel-doc
2026-09-12 0:21 [PATCH] HID: intel-thc-hid: intel-quicki2c: Fix the return value in quicki2c_dev_init() kernel-doc Karl Mehltretter
@ 2026-09-12 12:45 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-09-12 12:45 UTC (permalink / raw)
To: Karl Mehltretter
Cc: Even Xu, Xinpeng Sun, Jiri Kosina, Benjamin Tissoires,
linux-input, linux-kernel
On Sat, Sep 12, 2026 at 02:21:43AM +0200, Karl Mehltretter wrote:
> quicki2c_dev_init() returns an ERR_PTR() on failure, but its kernel-doc
> says that failure returns NULL. This mismatch was present in the
> original driver skeleton.
>
> Document the error pointer returned by the initialization paths.
...
> * Return: Pointer to the quicki2c_device structure if success
> - * or NULL on failure.
> + * or an ERR_PTR() on failure.
" * or an error pointer on failure."
> */
...
The rule of thumb: Among options always choose the one that is less cryptic and
uses more plain English.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-12 12:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-12 0:21 [PATCH] HID: intel-thc-hid: intel-quicki2c: Fix the return value in quicki2c_dev_init() kernel-doc Karl Mehltretter
2026-09-12 12:45 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®