From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-usb@vger.kernel.org
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>,
Lukas Wunner <lukas@wunner.de>,
Andreas Noever <andreas.noever@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH 12/26] thunderbolt: Update nvm.c function documentation
Date: Mon, 8 Sep 2025 18:32:16 +0200 [thread overview]
Message-ID: <20250908163230.2614397-13-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20250908163230.2614397-1-mika.westerberg@linux.intel.com>
From: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>
Make nvm.c function documentation compliant with current kernel-doc
standards. No functional changes.
Signed-off-by: Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/thunderbolt/nvm.c | 42 ++++++++++++++++++++++++---------------
1 file changed, 26 insertions(+), 16 deletions(-)
diff --git a/drivers/thunderbolt/nvm.c b/drivers/thunderbolt/nvm.c
index da11c8112e29..6901058b7ac0 100644
--- a/drivers/thunderbolt/nvm.c
+++ b/drivers/thunderbolt/nvm.c
@@ -278,9 +278,13 @@ static const struct tb_nvm_vendor retimer_nvm_vendors[] = {
* tb_nvm_alloc() - Allocate new NVM structure
* @dev: Device owning the NVM
*
- * Allocates new NVM structure with unique @id and returns it. In case
- * of error returns ERR_PTR(). Specifically returns %-EOPNOTSUPP if the
- * NVM format of the @dev is not known by the kernel.
+ * Allocates new NVM structure with unique @id and returns it.
+ *
+ * Return:
+ * * Pointer to &struct tb_nvm - On success.
+ * * %-EOPNOTSUPP - If the NVM format of the @dev is not known by the
+ * kernel.
+ * * %ERR_PTR - In case of failure.
*/
struct tb_nvm *tb_nvm_alloc(struct device *dev)
{
@@ -347,9 +351,10 @@ struct tb_nvm *tb_nvm_alloc(struct device *dev)
* tb_nvm_read_version() - Read and populate NVM version
* @nvm: NVM structure
*
- * Uses vendor specific means to read out and fill in the existing
- * active NVM version. Returns %0 in case of success and negative errno
- * otherwise.
+ * Uses vendor specific means to read and fill out the existing
+ * active NVM version.
+ *
+ * Return: %0 on success, negative errno otherwise.
*/
int tb_nvm_read_version(struct tb_nvm *nvm)
{
@@ -365,12 +370,11 @@ int tb_nvm_read_version(struct tb_nvm *nvm)
* tb_nvm_validate() - Validate new NVM image
* @nvm: NVM structure
*
- * Runs vendor specific validation over the new NVM image and if all
- * checks pass returns %0. As side effect updates @nvm->buf_data_start
- * and @nvm->buf_data_size fields to match the actual data to be written
- * to the NVM.
+ * Runs vendor specific validation over the new NVM image. As a
+ * side effect, updates @nvm->buf_data_start and @nvm->buf_data_size
+ * fields to match the actual data to be written to the NVM.
*
- * If the validation does not pass then returns negative errno.
+ * Return: %0 on successful validation, negative errno otherwise.
*/
int tb_nvm_validate(struct tb_nvm *nvm)
{
@@ -405,7 +409,7 @@ int tb_nvm_validate(struct tb_nvm *nvm)
* the image, this function does that. Can be called even if the device
* does not need this.
*
- * Returns %0 in case of success and negative errno otherwise.
+ * Return: %0 on success, negative errno otherwise.
*/
int tb_nvm_write_headers(struct tb_nvm *nvm)
{
@@ -423,7 +427,8 @@ int tb_nvm_write_headers(struct tb_nvm *nvm)
* Registers new active NVmem device for @nvm. The @reg_read is called
* directly from NVMem so it must handle possible concurrent access if
* needed. The first parameter passed to @reg_read is @nvm structure.
- * Returns %0 in success and negative errno otherwise.
+ *
+ * Return: %0 on success, negative errno otherwise.
*/
int tb_nvm_add_active(struct tb_nvm *nvm, nvmem_reg_read_t reg_read)
{
@@ -461,6 +466,11 @@ int tb_nvm_add_active(struct tb_nvm *nvm, nvmem_reg_read_t reg_read)
* Helper function to cache the new NVM image before it is actually
* written to the flash. Copies @bytes from @val to @nvm->buf starting
* from @offset.
+ *
+ * Return:
+ * * %0 - On success.
+ * * %-ENOMEM - If buffer allocation failed.
+ * * Negative errno - Another error occurred.
*/
int tb_nvm_write_buf(struct tb_nvm *nvm, unsigned int offset, void *val,
size_t bytes)
@@ -488,7 +498,7 @@ int tb_nvm_write_buf(struct tb_nvm *nvm, unsigned int offset, void *val,
* needed. The first parameter passed to @reg_write is @nvm structure.
* The size of the NVMem device is set to %NVM_MAX_SIZE.
*
- * Returns %0 in success and negative errno otherwise.
+ * Return: %0 on success, negative errno otherwise.
*/
int tb_nvm_add_non_active(struct tb_nvm *nvm, nvmem_reg_write_t reg_write)
{
@@ -545,7 +555,7 @@ void tb_nvm_free(struct tb_nvm *nvm)
* This is a generic function that reads data from NVM or NVM like
* device.
*
- * Returns %0 on success and negative errno otherwise.
+ * Return: %0 on success, negative errno otherwise.
*/
int tb_nvm_read_data(unsigned int address, void *buf, size_t size,
unsigned int retries, read_block_fn read_block,
@@ -592,7 +602,7 @@ int tb_nvm_read_data(unsigned int address, void *buf, size_t size,
*
* This is generic function that writes data to NVM or NVM like device.
*
- * Returns %0 on success and negative errno otherwise.
+ * Return: %0 on success, negative errno otherwise.
*/
int tb_nvm_write_data(unsigned int address, const void *buf, size_t size,
unsigned int retries, write_block_fn write_block,
--
2.50.1
next prev parent reply other threads:[~2025-09-08 16:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-08 16:32 [PATCH 00/26] thunderbolt: kernel-doc fixes Mika Westerberg
2025-09-08 16:32 ` [PATCH 01/26] thunderbolt: Update acpi.c function documentation Mika Westerberg
2025-09-08 16:32 ` [PATCH 02/26] thunderbolt: Update cap.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 03/26] thunderbolt: Update clx.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 04/26] thunderbolt: Update ctl.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 05/26] thunderbolt: Add missing documentation in ctl.h tb_cfg_request struct Mika Westerberg
2025-09-08 16:32 ` [PATCH 06/26] thunderbolt: Update dma_port.c function documentation Mika Westerberg
2025-09-08 16:32 ` [PATCH 07/26] thunderbolt: Update domain.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 08/26] thunderbolt: Update eeprom.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 09/26] thunderbolt: Update lc.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 10/26] thunderbolt: Update nhi.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 11/26] thunderbolt: Add missing documentation in nhi_regs.h ring_desc structure Mika Westerberg
2025-09-08 16:32 ` Mika Westerberg [this message]
2025-09-08 16:32 ` [PATCH 13/26] thunderbolt: Update path.c function documentation Mika Westerberg
2025-09-08 16:32 ` [PATCH 14/26] thunderbolt: Update property.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 15/26] thunderbolt: Update retimer.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 16/26] thunderbolt: Update switch.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 17/26] thunderbolt: Update tb.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 18/26] thunderbolt: Update tb.h " Mika Westerberg
2025-09-08 16:32 ` [PATCH 19/26] thunderbolt: Add missing documentation in tb.h Mika Westerberg
2025-09-08 16:32 ` [PATCH 20/26] thunderbolt: Update tmu.c function documentation Mika Westerberg
2025-09-08 16:32 ` [PATCH 21/26] thunderbolt: Update tunnel.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 22/26] thunderbolt: Update tunnel.h " Mika Westerberg
2025-09-08 16:32 ` [PATCH 23/26] thunderbolt: Update usb4.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 24/26] thunderbolt: Update usb4_port.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 25/26] thunderbolt: Update xdomain.c " Mika Westerberg
2025-09-08 16:32 ` [PATCH 26/26] thunderbolt: Update thunderbolt.h header file Mika Westerberg
2025-09-17 5:52 ` [PATCH 00/26] thunderbolt: kernel-doc fixes Mika Westerberg
2025-09-17 8:15 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250908163230.2614397-13-mika.westerberg@linux.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=alan.borzeszkowski@linux.intel.com \
--cc=andreas.noever@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-usb@vger.kernel.org \
--cc=lukas@wunner.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.