[PATCH] HID: intel-thc-hid: intel-quicki2c: Fix the return value in quicki2c_dev_init() kernel-doc

Karl Mehltretter posted 1 patch 1 week, 6 days ago
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] HID: intel-thc-hid: intel-quicki2c: Fix the return value in quicki2c_dev_init() kernel-doc
Posted by Karl Mehltretter 1 week, 6 days ago
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)
Re: [PATCH] HID: intel-thc-hid: intel-quicki2c: Fix the return value in quicki2c_dev_init() kernel-doc
Posted by Andy Shevchenko 1 week, 5 days ago
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