aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ixp4xx_crypto.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-06-10 14:09:45 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-10-31 10:49:11 -0400
commit27c1789ca6a6eae984b73d0267b7957e5c207da1 (patch)
tree339dc856d7a68c6d74bd9803d26cf0b3fee7ef32 /drivers/crypto/ixp4xx_crypto.c
parentd8cbc3f7921d0a50c032c8ee7131f8ee10c6b5a9 (diff)
DMA-API: crypto: remove last references to 'static struct device *dev'
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/crypto/ixp4xx_crypto.c')
-rw-r--r--drivers/crypto/ixp4xx_crypto.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c
index 830618579102..214357e12dc0 100644
--- a/drivers/crypto/ixp4xx_crypto.c
+++ b/drivers/crypto/ixp4xx_crypto.c
@@ -221,7 +221,6 @@ static int support_aes = 1;
221#define DRIVER_NAME "ixp4xx_crypto" 221#define DRIVER_NAME "ixp4xx_crypto"
222 222
223static struct platform_device *pdev; 223static struct platform_device *pdev;
224static struct device *dev;
225 224
226static inline dma_addr_t crypt_virt2phys(struct crypt_ctl *virt) 225static inline dma_addr_t crypt_virt2phys(struct crypt_ctl *virt)
227{ 226{
@@ -250,6 +249,7 @@ static inline const struct ix_hash_algo *ix_hash(struct crypto_tfm *tfm)
250 249
251static int setup_crypt_desc(void) 250static int setup_crypt_desc(void)
252{ 251{
252 struct device *dev = &pdev->dev;
253 BUILD_BUG_ON(sizeof(struct crypt_ctl) != 64); 253 BUILD_BUG_ON(sizeof(struct crypt_ctl) != 64);
254 crypt_virt = dma_alloc_coherent(dev, 254 crypt_virt = dma_alloc_coherent(dev,
255 NPE_QLEN * sizeof(struct crypt_ctl), 255 NPE_QLEN * sizeof(struct crypt_ctl),
@@ -350,6 +350,7 @@ static void finish_scattered_hmac(struct crypt_ctl *crypt)
350 350
351static void one_packet(dma_addr_t phys) 351static void one_packet(dma_addr_t phys)
352{ 352{
353 struct device *dev = &pdev->dev;
353 struct crypt_ctl *crypt; 354 struct crypt_ctl *crypt;
354 struct ixp_ctx *ctx; 355 struct ixp_ctx *ctx;
355 int failed; 356 int failed;
@@ -419,7 +420,7 @@ static void crypto_done_action(unsigned long arg)
419 tasklet_schedule(&crypto_done_tasklet); 420 tasklet_schedule(&crypto_done_tasklet);
420} 421}
421 422
422static int init_ixp_crypto(void) 423static int init_ixp_crypto(struct device *dev)
423{ 424{
424 int ret = -ENODEV; 425 int ret = -ENODEV;
425 u32 msg[2] = { 0, 0 }; 426 u32 msg[2] = { 0, 0 };
@@ -506,7 +507,7 @@ err:
506 return ret; 507 return ret;
507} 508}
508 509
509static void release_ixp_crypto(void) 510static void release_ixp_crypto(struct device *dev)
510{ 511{
511 qmgr_disable_irq(RECV_QID); 512 qmgr_disable_irq(RECV_QID);
512 tasklet_kill(&crypto_done_tasklet); 513 tasklet_kill(&crypto_done_tasklet);
@@ -873,6 +874,7 @@ static int ablk_perform(struct ablkcipher_request *req, int encrypt)
873 enum dma_data_direction src_direction = DMA_BIDIRECTIONAL; 874 enum dma_data_direction src_direction = DMA_BIDIRECTIONAL;
874 struct ablk_ctx *req_ctx = ablkcipher_request_ctx(req); 875 struct ablk_ctx *req_ctx = ablkcipher_request_ctx(req);
875 struct buffer_desc src_hook; 876 struct buffer_desc src_hook;
877 struct device *dev = &pdev->dev;
876 gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? 878 gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ?
877 GFP_KERNEL : GFP_ATOMIC; 879 GFP_KERNEL : GFP_ATOMIC;
878 880
@@ -997,6 +999,7 @@ static int aead_perform(struct aead_request *req, int encrypt,
997 unsigned int cryptlen; 999 unsigned int cryptlen;
998 struct buffer_desc *buf, src_hook; 1000 struct buffer_desc *buf, src_hook;
999 struct aead_ctx *req_ctx = aead_request_ctx(req); 1001 struct aead_ctx *req_ctx = aead_request_ctx(req);
1002 struct device *dev = &pdev->dev;
1000 gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? 1003 gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ?
1001 GFP_KERNEL : GFP_ATOMIC; 1004 GFP_KERNEL : GFP_ATOMIC;
1002 1005
@@ -1426,7 +1429,7 @@ static int __init ixp_module_init(void)
1426 spin_lock_init(&desc_lock); 1429 spin_lock_init(&desc_lock);
1427 spin_lock_init(&emerg_lock); 1430 spin_lock_init(&emerg_lock);
1428 1431
1429 err = init_ixp_crypto(); 1432 err = init_ixp_crypto(&pdev->dev);
1430 if (err) { 1433 if (err) {
1431 platform_device_unregister(pdev); 1434 platform_device_unregister(pdev);
1432 return err; 1435 return err;
@@ -1492,7 +1495,7 @@ static void __exit ixp_module_exit(void)
1492 if (ixp4xx_algos[i].registered) 1495 if (ixp4xx_algos[i].registered)
1493 crypto_unregister_alg(&ixp4xx_algos[i].crypto); 1496 crypto_unregister_alg(&ixp4xx_algos[i].crypto);
1494 } 1497 }
1495 release_ixp_crypto(); 1498 release_ixp_crypto(&pdev->dev);
1496 platform_device_unregister(pdev); 1499 platform_device_unregister(pdev);
1497} 1500}
1498 1501