Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: NCI: Use reinit_completion() at appropriate places

Calling init_completion() once is enough.
Then use reinit_completion() instead in __nci_request() and nci_spi_send().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Axel Lin and committed by
Samuel Ortiz
9bec44bf 6ea7398d

+4 -2
+2 -1
net/nfc/nci/core.c
··· 74 74 75 75 ndev->req_status = NCI_REQ_PEND; 76 76 77 - init_completion(&ndev->req_completion); 77 + reinit_completion(&ndev->req_completion); 78 78 req(ndev, opt); 79 79 completion_rc = 80 80 wait_for_completion_interruptible_timeout(&ndev->req_completion, ··· 709 709 ndev->ops = ops; 710 710 ndev->tx_headroom = tx_headroom; 711 711 ndev->tx_tailroom = tx_tailroom; 712 + init_completion(&ndev->req_completion); 712 713 713 714 ndev->nfc_dev = nfc_allocate_device(&nci_nfc_ops, 714 715 supported_protocols,
+2 -1
net/nfc/nci/spi.c
··· 105 105 if (ret != 0 || nspi->acknowledge_mode == NCI_SPI_CRC_DISABLED) 106 106 goto done; 107 107 108 - init_completion(&nspi->req_completion); 108 + reinit_completion(&nspi->req_completion); 109 109 completion_rc = wait_for_completion_interruptible_timeout( 110 110 &nspi->req_completion, 111 111 NCI_SPI_SEND_TIMEOUT); ··· 145 145 146 146 nspi->spi = spi; 147 147 nspi->ndev = ndev; 148 + init_completion(&nspi->req_completion); 148 149 149 150 return nspi; 150 151 }