aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-02-13 00:25:48 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2014-02-23 17:32:18 -0500
commit9bec44bf0bcd623b5ea48ae1ce44205260ad4b77 (patch)
tree0fe89e0fd0243370d05e023453a5a30eab0f335d /net/nfc
parent6ea7398d00345a33b47d905875416ca4421838de (diff)
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>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/nci/core.c3
-rw-r--r--net/nfc/nci/spi.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 46bda010bf11..28d07626b14d 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -74,7 +74,7 @@ static int __nci_request(struct nci_dev *ndev,
74 74
75 ndev->req_status = NCI_REQ_PEND; 75 ndev->req_status = NCI_REQ_PEND;
76 76
77 init_completion(&ndev->req_completion); 77 reinit_completion(&ndev->req_completion);
78 req(ndev, opt); 78 req(ndev, opt);
79 completion_rc = 79 completion_rc =
80 wait_for_completion_interruptible_timeout(&ndev->req_completion, 80 wait_for_completion_interruptible_timeout(&ndev->req_completion,
@@ -709,6 +709,7 @@ struct nci_dev *nci_allocate_device(struct nci_ops *ops,
709 ndev->ops = ops; 709 ndev->ops = ops;
710 ndev->tx_headroom = tx_headroom; 710 ndev->tx_headroom = tx_headroom;
711 ndev->tx_tailroom = tx_tailroom; 711 ndev->tx_tailroom = tx_tailroom;
712 init_completion(&ndev->req_completion);
712 713
713 ndev->nfc_dev = nfc_allocate_device(&nci_nfc_ops, 714 ndev->nfc_dev = nfc_allocate_device(&nci_nfc_ops,
714 supported_protocols, 715 supported_protocols,
diff --git a/net/nfc/nci/spi.c b/net/nfc/nci/spi.c
index f1d426f10cce..ec250e77763a 100644
--- a/net/nfc/nci/spi.c
+++ b/net/nfc/nci/spi.c
@@ -105,7 +105,7 @@ int nci_spi_send(struct nci_spi *nspi,
105 if (ret != 0 || nspi->acknowledge_mode == NCI_SPI_CRC_DISABLED) 105 if (ret != 0 || nspi->acknowledge_mode == NCI_SPI_CRC_DISABLED)
106 goto done; 106 goto done;
107 107
108 init_completion(&nspi->req_completion); 108 reinit_completion(&nspi->req_completion);
109 completion_rc = wait_for_completion_interruptible_timeout( 109 completion_rc = wait_for_completion_interruptible_timeout(
110 &nspi->req_completion, 110 &nspi->req_completion,
111 NCI_SPI_SEND_TIMEOUT); 111 NCI_SPI_SEND_TIMEOUT);
@@ -145,6 +145,7 @@ struct nci_spi *nci_spi_allocate_spi(struct spi_device *spi,
145 145
146 nspi->spi = spi; 146 nspi->spi = spi;
147 nspi->ndev = ndev; 147 nspi->ndev = ndev;
148 init_completion(&nspi->req_completion);
148 149
149 return nspi; 150 return nspi;
150} 151}