Skip to content

Commit 3caf1b4

Browse files
Lee Jonesgregkh
authored andcommitted
misc: ti-st: st_kim: Tidy-up bespoke commentry
If it's still in use and worth the effort, it sure looks like this driver could do with a good scrub (clean). This patch conserns itself with the non-standard comments located thoughout the file. It also fixes the following W=1 warnings by demoting the kerneldoc function headers to standard comments, since there doesn't appear to be a requirement for the function args to be documented: /drivers/misc/ti-st/st_kim.c:42: warning: Function parameter or member 'id' not described in 'st_get_plat_device' /drivers/misc/ti-st/st_kim.c:53: warning: Function parameter or member 'kim_gdata' not described in 'validate_firmware_response' /drivers/misc/ti-st/st_kim.c:126: warning: Function parameter or member 'kim_gdata' not described in 'kim_int_recv' /drivers/misc/ti-st/st_kim.c:126: warning: Function parameter or member 'data' not described in 'kim_int_recv' /drivers/misc/ti-st/st_kim.c:126: warning: Function parameter or member 'count' not described in 'kim_int_recv' /drivers/misc/ti-st/st_kim.c:272: warning: Function parameter or member 'kim_gdata' not described in 'download_firmware' /drivers/misc/ti-st/st_kim.c:445: warning: Function parameter or member 'kim_data' not described in 'st_kim_start' /drivers/misc/ti-st/st_kim.c:509: warning: Function parameter or member 'kim_data' not described in 'st_kim_stop' /drivers/misc/ti-st/st_kim.c:661: warning: Function parameter or member 'core_data' not described in 'st_kim_ref' /drivers/misc/ti-st/st_kim.c:661: warning: Function parameter or member 'id' not described in 'st_kim_ref' Cc: Pavan Savoy <pavan_savoy@ti.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20200626130525.389469-4-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7e8eebe commit 3caf1b4

1 file changed

Lines changed: 44 additions & 27 deletions

File tree

‎drivers/misc/ti-st/st_kim.c‎

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static struct platform_device *st_kim_devices[MAX_ST_DEVICES];
3030
/**********************************************************************/
3131
/* internal functions */
3232

33-
/**
33+
/*
3434
* st_get_plat_device -
3535
* function which returns the reference to the platform device
3636
* requested by id. As of now only 1 such device exists (id=0)
@@ -43,7 +43,7 @@ static struct platform_device *st_get_plat_device(int id)
4343
return st_kim_devices[id];
4444
}
4545

46-
/**
46+
/*
4747
* validate_firmware_response -
4848
* function to return whether the firmware response was proper
4949
* in case of error don't complete so that waiting for proper
@@ -55,7 +55,8 @@ static void validate_firmware_response(struct kim_data_s *kim_gdata)
5555
if (!skb)
5656
return;
5757

58-
/* these magic numbers are the position in the response buffer which
58+
/*
59+
* these magic numbers are the position in the response buffer which
5960
* allows us to distinguish whether the response is for the read
6061
* version info. command
6162
*/
@@ -79,7 +80,8 @@ static void validate_firmware_response(struct kim_data_s *kim_gdata)
7980
kfree_skb(skb);
8081
}
8182

82-
/* check for data len received inside kim_int_recv
83+
/*
84+
* check for data len received inside kim_int_recv
8385
* most often hit the last case to update state to waiting for data
8486
*/
8587
static inline int kim_check_data_len(struct kim_data_s *kim_gdata, int len)
@@ -91,31 +93,35 @@ static inline int kim_check_data_len(struct kim_data_s *kim_gdata, int len)
9193
if (!len) {
9294
validate_firmware_response(kim_gdata);
9395
} else if (len > room) {
94-
/* Received packet's payload length is larger.
96+
/*
97+
* Received packet's payload length is larger.
9598
* We can't accommodate it in created skb.
9699
*/
97100
pr_err("Data length is too large len %d room %d", len,
98101
room);
99102
kfree_skb(kim_gdata->rx_skb);
100103
} else {
101-
/* Packet header has non-zero payload length and
104+
/*
105+
* Packet header has non-zero payload length and
102106
* we have enough space in created skb. Lets read
103107
* payload data */
104108
kim_gdata->rx_state = ST_W4_DATA;
105109
kim_gdata->rx_count = len;
106110
return len;
107111
}
108112

109-
/* Change ST LL state to continue to process next
110-
* packet */
113+
/*
114+
* Change ST LL state to continue to process next
115+
* packet
116+
*/
111117
kim_gdata->rx_state = ST_W4_PACKET_TYPE;
112118
kim_gdata->rx_skb = NULL;
113119
kim_gdata->rx_count = 0;
114120

115121
return 0;
116122
}
117123

118-
/**
124+
/*
119125
* kim_int_recv - receive function called during firmware download
120126
* firmware download responses on different UART drivers
121127
* have been observed to come in bursts of different
@@ -216,7 +222,8 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
216222
return timeout ? -ERESTARTSYS : -ETIMEDOUT;
217223
}
218224
reinit_completion(&kim_gdata->kim_rcvd);
219-
/* the positions 12 & 13 in the response buffer provide with the
225+
/*
226+
* the positions 12 & 13 in the response buffer provide with the
220227
* chip, major & minor numbers
221228
*/
222229

@@ -263,7 +270,7 @@ static void skip_change_remote_baud(unsigned char **ptr, long *len)
263270
}
264271
}
265272

266-
/**
273+
/*
267274
* download_firmware -
268275
* internal function which parses through the .bts firmware
269276
* script file intreprets SEND, DELAY actions only as of now
@@ -295,7 +302,8 @@ static long download_firmware(struct kim_data_s *kim_gdata)
295302
}
296303
ptr = (void *)kim_gdata->fw_entry->data;
297304
len = kim_gdata->fw_entry->size;
298-
/* bts_header to remove out magic number and
305+
/*
306+
* bts_header to remove out magic number and
299307
* version
300308
*/
301309
ptr += sizeof(struct bts_header);
@@ -313,8 +321,10 @@ static long download_firmware(struct kim_data_s *kim_gdata)
313321
if (unlikely
314322
(((struct hci_command *)action_ptr)->opcode ==
315323
0xFF36)) {
316-
/* ignore remote change
317-
* baud rate HCI VS command */
324+
/*
325+
* ignore remote change
326+
* baud rate HCI VS command
327+
*/
318328
pr_warn("change remote baud"
319329
" rate command in firmware");
320330
skip_change_remote_baud(&ptr, &len);
@@ -346,7 +356,8 @@ static long download_firmware(struct kim_data_s *kim_gdata)
346356
release_firmware(kim_gdata->fw_entry);
347357
return -ETIMEDOUT;
348358
}
349-
/* reinit completion before sending for the
359+
/*
360+
* reinit completion before sending for the
350361
* relevant wait
351362
*/
352363
reinit_completion(&kim_gdata->kim_rcvd);
@@ -418,14 +429,16 @@ void st_kim_recv(void *disc_data, const unsigned char *data, long count)
418429
struct st_data_s *st_gdata = (struct st_data_s *)disc_data;
419430
struct kim_data_s *kim_gdata = st_gdata->kim_data;
420431

421-
/* proceed to gather all data and distinguish read fw version response
432+
/*
433+
* proceed to gather all data and distinguish read fw version response
422434
* from other fw responses when data gathering is complete
423435
*/
424436
kim_int_recv(kim_gdata, data, count);
425437
return;
426438
}
427439

428-
/* to signal completion of line discipline installation
440+
/*
441+
* to signal completion of line discipline installation
429442
* called from ST Core, upon tty_open
430443
*/
431444
void st_kim_complete(void *kim_data)
@@ -434,7 +447,7 @@ void st_kim_complete(void *kim_data)
434447
complete(&kim_gdata->ldisc_installed);
435448
}
436449

437-
/**
450+
/*
438451
* st_kim_start - called from ST Core upon 1st registration
439452
* This involves toggling the chip enable gpio, reading
440453
* the firmware version from chip, forming the fw file name
@@ -472,8 +485,10 @@ long st_kim_start(void *kim_data)
472485
err = wait_for_completion_interruptible_timeout(
473486
&kim_gdata->ldisc_installed, msecs_to_jiffies(LDISC_TIME));
474487
if (!err) {
475-
/* ldisc installation timeout,
476-
* flush uart, power cycle BT_EN */
488+
/*
489+
* ldisc installation timeout,
490+
* flush uart, power cycle BT_EN
491+
*/
477492
pr_err("ldisc installation timeout");
478493
err = st_kim_stop(kim_gdata);
479494
continue;
@@ -482,8 +497,10 @@ long st_kim_start(void *kim_data)
482497
pr_info("line discipline installed");
483498
err = download_firmware(kim_gdata);
484499
if (err != 0) {
485-
/* ldisc installed but fw download failed,
486-
* flush uart & power cycle BT_EN */
500+
/*
501+
* ldisc installed but fw download failed,
502+
* flush uart & power cycle BT_EN
503+
*/
487504
pr_err("download firmware failed");
488505
err = st_kim_stop(kim_gdata);
489506
continue;
@@ -495,7 +512,7 @@ long st_kim_start(void *kim_data)
495512
return err;
496513
}
497514

498-
/**
515+
/*
499516
* st_kim_stop - stop communication with chip.
500517
* This can be called from ST Core/KIM, on the-
501518
* (a) last un-register when chip need not be powered there-after,
@@ -650,7 +667,7 @@ static const struct attribute_group uim_attr_grp = {
650667
.attrs = uim_attrs,
651668
};
652669

653-
/**
670+
/*
654671
* st_kim_ref - reference the core's data
655672
* This references the per-ST platform device in the arch/xx/
656673
* board-xx.c file.
@@ -729,8 +746,7 @@ static int kim_probe(struct platform_device *pdev)
729746
pr_err(" unable to configure gpio %d", kim_gdata->nshutdown);
730747
goto err_sysfs_group;
731748
}
732-
/* get reference of pdev for request_firmware
733-
*/
749+
/* get reference of pdev for request_firmware */
734750
kim_gdata->kim_pdev = pdev;
735751
init_completion(&kim_gdata->kim_rcvd);
736752
init_completion(&kim_gdata->ldisc_installed);
@@ -772,7 +788,8 @@ static int kim_remove(struct platform_device *pdev)
772788

773789
kim_gdata = platform_get_drvdata(pdev);
774790

775-
/* Free the Bluetooth/FM/GPIO
791+
/*
792+
* Free the Bluetooth/FM/GPIO
776793
* nShutdown gpio from the system
777794
*/
778795
gpio_free(pdata->nshutdown_gpio);

0 commit comments

Comments
 (0)