Commit 27c1789c authored by Russell King's avatar Russell King

DMA-API: crypto: remove last references to 'static struct device *dev'

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent d8cbc3f7
...@@ -221,7 +221,6 @@ static int support_aes = 1; ...@@ -221,7 +221,6 @@ static int support_aes = 1;
#define DRIVER_NAME "ixp4xx_crypto" #define DRIVER_NAME "ixp4xx_crypto"
static struct platform_device *pdev; static struct platform_device *pdev;
static struct device *dev;
static inline dma_addr_t crypt_virt2phys(struct crypt_ctl *virt) static inline dma_addr_t crypt_virt2phys(struct crypt_ctl *virt)
{ {
...@@ -250,6 +249,7 @@ static inline const struct ix_hash_algo *ix_hash(struct crypto_tfm *tfm) ...@@ -250,6 +249,7 @@ static inline const struct ix_hash_algo *ix_hash(struct crypto_tfm *tfm)
static int setup_crypt_desc(void) static int setup_crypt_desc(void)
{ {
struct device *dev = &pdev->dev;
BUILD_BUG_ON(sizeof(struct crypt_ctl) != 64); BUILD_BUG_ON(sizeof(struct crypt_ctl) != 64);
crypt_virt = dma_alloc_coherent(dev, crypt_virt = dma_alloc_coherent(dev,
NPE_QLEN * sizeof(struct crypt_ctl), NPE_QLEN * sizeof(struct crypt_ctl),
...@@ -350,6 +350,7 @@ static void finish_scattered_hmac(struct crypt_ctl *crypt) ...@@ -350,6 +350,7 @@ static void finish_scattered_hmac(struct crypt_ctl *crypt)
static void one_packet(dma_addr_t phys) static void one_packet(dma_addr_t phys)
{ {
struct device *dev = &pdev->dev;
struct crypt_ctl *crypt; struct crypt_ctl *crypt;
struct ixp_ctx *ctx; struct ixp_ctx *ctx;
int failed; int failed;
...@@ -419,7 +420,7 @@ static void crypto_done_action(unsigned long arg) ...@@ -419,7 +420,7 @@ static void crypto_done_action(unsigned long arg)
tasklet_schedule(&crypto_done_tasklet); tasklet_schedule(&crypto_done_tasklet);
} }
static int init_ixp_crypto(void) static int init_ixp_crypto(struct device *dev)
{ {
int ret = -ENODEV; int ret = -ENODEV;
u32 msg[2] = { 0, 0 }; u32 msg[2] = { 0, 0 };
...@@ -506,7 +507,7 @@ static int init_ixp_crypto(void) ...@@ -506,7 +507,7 @@ static int init_ixp_crypto(void)
return ret; return ret;
} }
static void release_ixp_crypto(void) static void release_ixp_crypto(struct device *dev)
{ {
qmgr_disable_irq(RECV_QID); qmgr_disable_irq(RECV_QID);
tasklet_kill(&crypto_done_tasklet); tasklet_kill(&crypto_done_tasklet);
...@@ -873,6 +874,7 @@ static int ablk_perform(struct ablkcipher_request *req, int encrypt) ...@@ -873,6 +874,7 @@ static int ablk_perform(struct ablkcipher_request *req, int encrypt)
enum dma_data_direction src_direction = DMA_BIDIRECTIONAL; enum dma_data_direction src_direction = DMA_BIDIRECTIONAL;
struct ablk_ctx *req_ctx = ablkcipher_request_ctx(req); struct ablk_ctx *req_ctx = ablkcipher_request_ctx(req);
struct buffer_desc src_hook; struct buffer_desc src_hook;
struct device *dev = &pdev->dev;
gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ?
GFP_KERNEL : GFP_ATOMIC; GFP_KERNEL : GFP_ATOMIC;
...@@ -997,6 +999,7 @@ static int aead_perform(struct aead_request *req, int encrypt, ...@@ -997,6 +999,7 @@ static int aead_perform(struct aead_request *req, int encrypt,
unsigned int cryptlen; unsigned int cryptlen;
struct buffer_desc *buf, src_hook; struct buffer_desc *buf, src_hook;
struct aead_ctx *req_ctx = aead_request_ctx(req); struct aead_ctx *req_ctx = aead_request_ctx(req);
struct device *dev = &pdev->dev;
gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ?
GFP_KERNEL : GFP_ATOMIC; GFP_KERNEL : GFP_ATOMIC;
...@@ -1426,7 +1429,7 @@ static int __init ixp_module_init(void) ...@@ -1426,7 +1429,7 @@ static int __init ixp_module_init(void)
spin_lock_init(&desc_lock); spin_lock_init(&desc_lock);
spin_lock_init(&emerg_lock); spin_lock_init(&emerg_lock);
err = init_ixp_crypto(); err = init_ixp_crypto(&pdev->dev);
if (err) { if (err) {
platform_device_unregister(pdev); platform_device_unregister(pdev);
return err; return err;
...@@ -1492,7 +1495,7 @@ static void __exit ixp_module_exit(void) ...@@ -1492,7 +1495,7 @@ static void __exit ixp_module_exit(void)
if (ixp4xx_algos[i].registered) if (ixp4xx_algos[i].registered)
crypto_unregister_alg(&ixp4xx_algos[i].crypto); crypto_unregister_alg(&ixp4xx_algos[i].crypto);
} }
release_ixp_crypto(); release_ixp_crypto(&pdev->dev);
platform_device_unregister(pdev); platform_device_unregister(pdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment