Skip to content

Commit 1c52be8

Browse files
avolmat-stbroonie
authored andcommitted
spi: stm32: Fix comments compilation warnings
Fix all functions and structure descriptions to have the driver warning free when built with W=1. Signed-off-by: Alain Volmat <[email protected]> Reviewed-by: Amelie Delaunay <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c528ecf commit 1c52be8

File tree

1 file changed

+45
-17
lines changed

1 file changed

+45
-17
lines changed

drivers/spi/spi-stm32.c

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
#define SPI_DMA_MIN_BYTES 16
176176

177177
/**
178-
* stm32_spi_reg - stm32 SPI register & bitfield desc
178+
* struct stm32_spi_reg - stm32 SPI register & bitfield desc
179179
* @reg: register offset
180180
* @mask: bitfield mask
181181
* @shift: left shift
@@ -187,16 +187,16 @@ struct stm32_spi_reg {
187187
};
188188

189189
/**
190-
* stm32_spi_regspec - stm32 registers definition, compatible dependent data
191-
* en: enable register and SPI enable bit
192-
* dma_rx_en: SPI DMA RX enable register end SPI DMA RX enable bit
193-
* dma_tx_en: SPI DMA TX enable register end SPI DMA TX enable bit
194-
* cpol: clock polarity register and polarity bit
195-
* cpha: clock phase register and phase bit
196-
* lsb_first: LSB transmitted first register and bit
197-
* br: baud rate register and bitfields
198-
* rx: SPI RX data register
199-
* tx: SPI TX data register
190+
* struct stm32_spi_regspec - stm32 registers definition, compatible dependent data
191+
* @en: enable register and SPI enable bit
192+
* @dma_rx_en: SPI DMA RX enable register end SPI DMA RX enable bit
193+
* @dma_tx_en: SPI DMA TX enable register end SPI DMA TX enable bit
194+
* @cpol: clock polarity register and polarity bit
195+
* @cpha: clock phase register and phase bit
196+
* @lsb_first: LSB transmitted first register and bit
197+
* @br: baud rate register and bitfields
198+
* @rx: SPI RX data register
199+
* @tx: SPI TX data register
200200
*/
201201
struct stm32_spi_regspec {
202202
const struct stm32_spi_reg en;
@@ -213,7 +213,7 @@ struct stm32_spi_regspec {
213213
struct stm32_spi;
214214

215215
/**
216-
* stm32_spi_cfg - stm32 compatible configuration data
216+
* struct stm32_spi_cfg - stm32 compatible configuration data
217217
* @regs: registers descriptions
218218
* @get_fifo_size: routine to get fifo size
219219
* @get_bpw_mask: routine to get bits per word mask
@@ -223,13 +223,13 @@ struct stm32_spi;
223223
* @set_mode: routine to configure registers to desired mode
224224
* @set_data_idleness: optional routine to configure registers to desired idle
225225
* time between frames (if driver has this functionality)
226-
* set_number_of_data: optional routine to configure registers to desired
226+
* @set_number_of_data: optional routine to configure registers to desired
227227
* number of data (if driver has this functionality)
228228
* @can_dma: routine to determine if the transfer is eligible for DMA use
229229
* @transfer_one_dma_start: routine to start transfer a single spi_transfer
230230
* using DMA
231-
* @dma_rx cb: routine to call after DMA RX channel operation is complete
232-
* @dma_tx cb: routine to call after DMA TX channel operation is complete
231+
* @dma_rx_cb: routine to call after DMA RX channel operation is complete
232+
* @dma_tx_cb: routine to call after DMA TX channel operation is complete
233233
* @transfer_one_irq: routine to configure interrupts for driver
234234
* @irq_handler_event: Interrupt handler for SPI controller events
235235
* @irq_handler_thread: thread of interrupt handler for SPI controller
@@ -587,6 +587,7 @@ static void stm32f4_spi_read_rx(struct stm32_spi *spi)
587587
/**
588588
* stm32h7_spi_read_rxfifo - Read bytes in Receive Data Register
589589
* @spi: pointer to the spi controller data structure
590+
* @flush: boolean indicating that FIFO should be flushed
590591
*
591592
* Write in rx_buf depends on remaining bytes to avoid to write beyond
592593
* rx_buf end.
@@ -756,6 +757,9 @@ static void stm32h7_spi_disable(struct stm32_spi *spi)
756757

757758
/**
758759
* stm32_spi_can_dma - Determine if the transfer is eligible for DMA use
760+
* @master: controller master interface
761+
* @spi_dev: pointer to the spi device
762+
* @transfer: pointer to spi transfer
759763
*
760764
* If driver has fifo and the current transfer size is greater than fifo size,
761765
* use DMA. Otherwise use DMA for transfer longer than defined DMA min bytes.
@@ -974,6 +978,8 @@ static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id)
974978

975979
/**
976980
* stm32_spi_prepare_msg - set up the controller to transfer a single message
981+
* @master: controller master interface
982+
* @msg: pointer to spi message
977983
*/
978984
static int stm32_spi_prepare_msg(struct spi_master *master,
979985
struct spi_message *msg)
@@ -1026,6 +1032,7 @@ static int stm32_spi_prepare_msg(struct spi_master *master,
10261032

10271033
/**
10281034
* stm32f4_spi_dma_tx_cb - dma callback
1035+
* @data: pointer to the spi controller data structure
10291036
*
10301037
* DMA callback is called when the transfer is complete for DMA TX channel.
10311038
*/
@@ -1041,6 +1048,7 @@ static void stm32f4_spi_dma_tx_cb(void *data)
10411048

10421049
/**
10431050
* stm32f4_spi_dma_rx_cb - dma callback
1051+
* @data: pointer to the spi controller data structure
10441052
*
10451053
* DMA callback is called when the transfer is complete for DMA RX channel.
10461054
*/
@@ -1054,6 +1062,7 @@ static void stm32f4_spi_dma_rx_cb(void *data)
10541062

10551063
/**
10561064
* stm32h7_spi_dma_cb - dma callback
1065+
* @data: pointer to the spi controller data structure
10571066
*
10581067
* DMA callback is called when the transfer is complete or when an error
10591068
* occurs. If the transfer is complete, EOT flag is raised.
@@ -1079,6 +1088,9 @@ static void stm32h7_spi_dma_cb(void *data)
10791088
/**
10801089
* stm32_spi_dma_config - configure dma slave channel depending on current
10811090
* transfer bits_per_word.
1091+
* @spi: pointer to the spi controller data structure
1092+
* @dma_conf: pointer to the dma_slave_config structure
1093+
* @dir: direction of the dma transfer
10821094
*/
10831095
static void stm32_spi_dma_config(struct stm32_spi *spi,
10841096
struct dma_slave_config *dma_conf,
@@ -1126,6 +1138,7 @@ static void stm32_spi_dma_config(struct stm32_spi *spi,
11261138
/**
11271139
* stm32f4_spi_transfer_one_irq - transfer a single spi_transfer using
11281140
* interrupts
1141+
* @spi: pointer to the spi controller data structure
11291142
*
11301143
* It must returns 0 if the transfer is finished or 1 if the transfer is still
11311144
* in progress.
@@ -1166,6 +1179,7 @@ static int stm32f4_spi_transfer_one_irq(struct stm32_spi *spi)
11661179
/**
11671180
* stm32h7_spi_transfer_one_irq - transfer a single spi_transfer using
11681181
* interrupts
1182+
* @spi: pointer to the spi controller data structure
11691183
*
11701184
* It must returns 0 if the transfer is finished or 1 if the transfer is still
11711185
* in progress.
@@ -1207,6 +1221,7 @@ static int stm32h7_spi_transfer_one_irq(struct stm32_spi *spi)
12071221
/**
12081222
* stm32f4_spi_transfer_one_dma_start - Set SPI driver registers to start
12091223
* transfer using DMA
1224+
* @spi: pointer to the spi controller data structure
12101225
*/
12111226
static void stm32f4_spi_transfer_one_dma_start(struct stm32_spi *spi)
12121227
{
@@ -1227,6 +1242,7 @@ static void stm32f4_spi_transfer_one_dma_start(struct stm32_spi *spi)
12271242
/**
12281243
* stm32h7_spi_transfer_one_dma_start - Set SPI driver registers to start
12291244
* transfer using DMA
1245+
* @spi: pointer to the spi controller data structure
12301246
*/
12311247
static void stm32h7_spi_transfer_one_dma_start(struct stm32_spi *spi)
12321248
{
@@ -1243,6 +1259,8 @@ static void stm32h7_spi_transfer_one_dma_start(struct stm32_spi *spi)
12431259

12441260
/**
12451261
* stm32_spi_transfer_one_dma - transfer a single spi_transfer using DMA
1262+
* @spi: pointer to the spi controller data structure
1263+
* @xfer: pointer to the spi_transfer structure
12461264
*
12471265
* It must returns 0 if the transfer is finished or 1 if the transfer is still
12481266
* in progress.
@@ -1405,7 +1423,7 @@ static void stm32_spi_set_mbr(struct stm32_spi *spi, u32 mbrdiv)
14051423
/**
14061424
* stm32_spi_communication_type - return transfer communication type
14071425
* @spi_dev: pointer to the spi device
1408-
* transfer: pointer to spi transfer
1426+
* @transfer: pointer to spi transfer
14091427
*/
14101428
static unsigned int stm32_spi_communication_type(struct spi_device *spi_dev,
14111429
struct spi_transfer *transfer)
@@ -1522,7 +1540,7 @@ static void stm32h7_spi_data_idleness(struct stm32_spi *spi, u32 len)
15221540
/**
15231541
* stm32h7_spi_number_of_data - configure number of data at current transfer
15241542
* @spi: pointer to the spi controller data structure
1525-
* @len: transfer length
1543+
* @nb_words: transfer length (in words)
15261544
*/
15271545
static int stm32h7_spi_number_of_data(struct stm32_spi *spi, u32 nb_words)
15281546
{
@@ -1546,6 +1564,9 @@ static int stm32h7_spi_number_of_data(struct stm32_spi *spi, u32 nb_words)
15461564
* stm32_spi_transfer_one_setup - common setup to transfer a single
15471565
* spi_transfer either using DMA or
15481566
* interrupts.
1567+
* @spi: pointer to the spi controller data structure
1568+
* @spi_dev: pointer to the spi device
1569+
* @transfer: pointer to spi transfer
15491570
*/
15501571
static int stm32_spi_transfer_one_setup(struct stm32_spi *spi,
15511572
struct spi_device *spi_dev,
@@ -1625,6 +1646,9 @@ static int stm32_spi_transfer_one_setup(struct stm32_spi *spi,
16251646

16261647
/**
16271648
* stm32_spi_transfer_one - transfer a single spi_transfer
1649+
* @master: controller master interface
1650+
* @spi_dev: pointer to the spi device
1651+
* @transfer: pointer to spi transfer
16281652
*
16291653
* It must return 0 if the transfer is finished or 1 if the transfer is still
16301654
* in progress.
@@ -1658,6 +1682,8 @@ static int stm32_spi_transfer_one(struct spi_master *master,
16581682

16591683
/**
16601684
* stm32_spi_unprepare_msg - relax the hardware
1685+
* @master: controller master interface
1686+
* @msg: pointer to the spi message
16611687
*/
16621688
static int stm32_spi_unprepare_msg(struct spi_master *master,
16631689
struct spi_message *msg)
@@ -1671,6 +1697,7 @@ static int stm32_spi_unprepare_msg(struct spi_master *master,
16711697

16721698
/**
16731699
* stm32f4_spi_config - Configure SPI controller as SPI master
1700+
* @spi: pointer to the spi controller data structure
16741701
*/
16751702
static int stm32f4_spi_config(struct stm32_spi *spi)
16761703
{
@@ -1701,6 +1728,7 @@ static int stm32f4_spi_config(struct stm32_spi *spi)
17011728

17021729
/**
17031730
* stm32h7_spi_config - Configure SPI controller as SPI master
1731+
* @spi: pointer to the spi controller data structure
17041732
*/
17051733
static int stm32h7_spi_config(struct stm32_spi *spi)
17061734
{

0 commit comments

Comments
 (0)