Skip to content

Commit fe83a27

Browse files
aborzeszwesteri
authored andcommitted
thunderbolt: Update nvm.c function documentation
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>
1 parent bbbca9b commit fe83a27

1 file changed

Lines changed: 26 additions & 16 deletions

File tree

drivers/thunderbolt/nvm.c

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,13 @@ static const struct tb_nvm_vendor retimer_nvm_vendors[] = {
278278
* tb_nvm_alloc() - Allocate new NVM structure
279279
* @dev: Device owning the NVM
280280
*
281-
* Allocates new NVM structure with unique @id and returns it. In case
282-
* of error returns ERR_PTR(). Specifically returns %-EOPNOTSUPP if the
283-
* NVM format of the @dev is not known by the kernel.
281+
* Allocates new NVM structure with unique @id and returns it.
282+
*
283+
* Return:
284+
* * Pointer to &struct tb_nvm - On success.
285+
* * %-EOPNOTSUPP - If the NVM format of the @dev is not known by the
286+
* kernel.
287+
* * %ERR_PTR - In case of failure.
284288
*/
285289
struct tb_nvm *tb_nvm_alloc(struct device *dev)
286290
{
@@ -347,9 +351,10 @@ struct tb_nvm *tb_nvm_alloc(struct device *dev)
347351
* tb_nvm_read_version() - Read and populate NVM version
348352
* @nvm: NVM structure
349353
*
350-
* Uses vendor specific means to read out and fill in the existing
351-
* active NVM version. Returns %0 in case of success and negative errno
352-
* otherwise.
354+
* Uses vendor specific means to read and fill out the existing
355+
* active NVM version.
356+
*
357+
* Return: %0 on success, negative errno otherwise.
353358
*/
354359
int tb_nvm_read_version(struct tb_nvm *nvm)
355360
{
@@ -365,12 +370,11 @@ int tb_nvm_read_version(struct tb_nvm *nvm)
365370
* tb_nvm_validate() - Validate new NVM image
366371
* @nvm: NVM structure
367372
*
368-
* Runs vendor specific validation over the new NVM image and if all
369-
* checks pass returns %0. As side effect updates @nvm->buf_data_start
370-
* and @nvm->buf_data_size fields to match the actual data to be written
371-
* to the NVM.
373+
* Runs vendor specific validation over the new NVM image. As a
374+
* side effect, updates @nvm->buf_data_start and @nvm->buf_data_size
375+
* fields to match the actual data to be written to the NVM.
372376
*
373-
* If the validation does not pass then returns negative errno.
377+
* Return: %0 on successful validation, negative errno otherwise.
374378
*/
375379
int tb_nvm_validate(struct tb_nvm *nvm)
376380
{
@@ -405,7 +409,7 @@ int tb_nvm_validate(struct tb_nvm *nvm)
405409
* the image, this function does that. Can be called even if the device
406410
* does not need this.
407411
*
408-
* Returns %0 in case of success and negative errno otherwise.
412+
* Return: %0 on success, negative errno otherwise.
409413
*/
410414
int tb_nvm_write_headers(struct tb_nvm *nvm)
411415
{
@@ -423,7 +427,8 @@ int tb_nvm_write_headers(struct tb_nvm *nvm)
423427
* Registers new active NVmem device for @nvm. The @reg_read is called
424428
* directly from NVMem so it must handle possible concurrent access if
425429
* needed. The first parameter passed to @reg_read is @nvm structure.
426-
* Returns %0 in success and negative errno otherwise.
430+
*
431+
* Return: %0 on success, negative errno otherwise.
427432
*/
428433
int tb_nvm_add_active(struct tb_nvm *nvm, nvmem_reg_read_t reg_read)
429434
{
@@ -461,6 +466,11 @@ int tb_nvm_add_active(struct tb_nvm *nvm, nvmem_reg_read_t reg_read)
461466
* Helper function to cache the new NVM image before it is actually
462467
* written to the flash. Copies @bytes from @val to @nvm->buf starting
463468
* from @offset.
469+
*
470+
* Return:
471+
* * %0 - On success.
472+
* * %-ENOMEM - If buffer allocation failed.
473+
* * Negative errno - Another error occurred.
464474
*/
465475
int tb_nvm_write_buf(struct tb_nvm *nvm, unsigned int offset, void *val,
466476
size_t bytes)
@@ -488,7 +498,7 @@ int tb_nvm_write_buf(struct tb_nvm *nvm, unsigned int offset, void *val,
488498
* needed. The first parameter passed to @reg_write is @nvm structure.
489499
* The size of the NVMem device is set to %NVM_MAX_SIZE.
490500
*
491-
* Returns %0 in success and negative errno otherwise.
501+
* Return: %0 on success, negative errno otherwise.
492502
*/
493503
int tb_nvm_add_non_active(struct tb_nvm *nvm, nvmem_reg_write_t reg_write)
494504
{
@@ -545,7 +555,7 @@ void tb_nvm_free(struct tb_nvm *nvm)
545555
* This is a generic function that reads data from NVM or NVM like
546556
* device.
547557
*
548-
* Returns %0 on success and negative errno otherwise.
558+
* Return: %0 on success, negative errno otherwise.
549559
*/
550560
int tb_nvm_read_data(unsigned int address, void *buf, size_t size,
551561
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,
592602
*
593603
* This is generic function that writes data to NVM or NVM like device.
594604
*
595-
* Returns %0 on success and negative errno otherwise.
605+
* Return: %0 on success, negative errno otherwise.
596606
*/
597607
int tb_nvm_write_data(unsigned int address, const void *buf, size_t size,
598608
unsigned int retries, write_block_fn write_block,

0 commit comments

Comments
 (0)