diff options
author | Ruchika Gupta <ruchika.gupta@freescale.com> | 2013-07-31 06:18:56 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-07-31 20:55:40 -0400 |
commit | 6dad41158db696d77eb17df12d5b1f3e196a7f2f (patch) | |
tree | 08ef3d8894ea10a7cab292cf961cf903f385c157 /drivers/crypto/caam/jr.c | |
parent | 674349f365ce7ac2b826edc619907a19c7136822 (diff) |
crypto: caam - Remove unused functions from Job Ring
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/caam/jr.c')
-rw-r--r-- | drivers/crypto/caam/jr.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index b4aa773ecbc8..105ba4da6180 100644 --- a/drivers/crypto/caam/jr.c +++ b/drivers/crypto/caam/jr.c | |||
@@ -126,72 +126,6 @@ static void caam_jr_dequeue(unsigned long devarg) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | /** | 128 | /** |
129 | * caam_jr_register() - Alloc a ring for someone to use as needed. Returns | ||
130 | * an ordinal of the rings allocated, else returns -ENODEV if no rings | ||
131 | * are available. | ||
132 | * @ctrldev: points to the controller level dev (parent) that | ||
133 | * owns rings available for use. | ||
134 | * @dev: points to where a pointer to the newly allocated queue's | ||
135 | * dev can be written to if successful. | ||
136 | **/ | ||
137 | int caam_jr_register(struct device *ctrldev, struct device **rdev) | ||
138 | { | ||
139 | struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); | ||
140 | struct caam_drv_private_jr *jrpriv = NULL; | ||
141 | int ring; | ||
142 | |||
143 | /* Lock, if free ring - assign, unlock */ | ||
144 | spin_lock(&ctrlpriv->jr_alloc_lock); | ||
145 | for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) { | ||
146 | jrpriv = dev_get_drvdata(ctrlpriv->jrdev[ring]); | ||
147 | if (jrpriv->assign == JOBR_UNASSIGNED) { | ||
148 | jrpriv->assign = JOBR_ASSIGNED; | ||
149 | *rdev = ctrlpriv->jrdev[ring]; | ||
150 | spin_unlock(&ctrlpriv->jr_alloc_lock); | ||
151 | return ring; | ||
152 | } | ||
153 | } | ||
154 | |||
155 | /* If assigned, write dev where caller needs it */ | ||
156 | spin_unlock(&ctrlpriv->jr_alloc_lock); | ||
157 | *rdev = NULL; | ||
158 | |||
159 | return -ENODEV; | ||
160 | } | ||
161 | EXPORT_SYMBOL(caam_jr_register); | ||
162 | |||
163 | /** | ||
164 | * caam_jr_deregister() - Deregister an API and release the queue. | ||
165 | * Returns 0 if OK, -EBUSY if queue still contains pending entries | ||
166 | * or unprocessed results at the time of the call | ||
167 | * @dev - points to the dev that identifies the queue to | ||
168 | * be released. | ||
169 | **/ | ||
170 | int caam_jr_deregister(struct device *rdev) | ||
171 | { | ||
172 | struct caam_drv_private_jr *jrpriv = dev_get_drvdata(rdev); | ||
173 | struct caam_drv_private *ctrlpriv; | ||
174 | |||
175 | /* Get the owning controller's private space */ | ||
176 | ctrlpriv = dev_get_drvdata(jrpriv->parentdev); | ||
177 | |||
178 | /* | ||
179 | * Make sure ring empty before release | ||
180 | */ | ||
181 | if (rd_reg32(&jrpriv->rregs->outring_used) || | ||
182 | (rd_reg32(&jrpriv->rregs->inpring_avail) != JOBR_DEPTH)) | ||
183 | return -EBUSY; | ||
184 | |||
185 | /* Release ring */ | ||
186 | spin_lock(&ctrlpriv->jr_alloc_lock); | ||
187 | jrpriv->assign = JOBR_UNASSIGNED; | ||
188 | spin_unlock(&ctrlpriv->jr_alloc_lock); | ||
189 | |||
190 | return 0; | ||
191 | } | ||
192 | EXPORT_SYMBOL(caam_jr_deregister); | ||
193 | |||
194 | /** | ||
195 | * caam_jr_enqueue() - Enqueue a job descriptor head. Returns 0 if OK, | 129 | * caam_jr_enqueue() - Enqueue a job descriptor head. Returns 0 if OK, |
196 | * -EBUSY if the queue is full, -EIO if it cannot map the caller's | 130 | * -EBUSY if the queue is full, -EIO if it cannot map the caller's |
197 | * descriptor. | 131 | * descriptor. |
@@ -379,7 +313,6 @@ static int caam_jr_init(struct device *dev) | |||
379 | (JOBR_INTC_COUNT_THLD << JRCFG_ICDCT_SHIFT) | | 313 | (JOBR_INTC_COUNT_THLD << JRCFG_ICDCT_SHIFT) | |
380 | (JOBR_INTC_TIME_THLD << JRCFG_ICTT_SHIFT)); | 314 | (JOBR_INTC_TIME_THLD << JRCFG_ICTT_SHIFT)); |
381 | 315 | ||
382 | jrp->assign = JOBR_UNASSIGNED; | ||
383 | return 0; | 316 | return 0; |
384 | } | 317 | } |
385 | 318 | ||