diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 12:28:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 12:28:16 -0400 |
commit | 59ecc26004e77e100c700b1d0da7502b0fdadb46 (patch) | |
tree | 1faec47bda8439cc2cbe3bd9bf15756e67808e63 /drivers/char/hw_random/atmel-rng.c | |
parent | bea803183e12a1c78a12ec70907174d13d958333 (diff) | |
parent | 8ceee72808d1ae3fb191284afc2257a2be964725 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu:
"Here is the crypto update for 3.15:
- Added 3DES driver for OMAP4/AM43xx
- Added AVX2 acceleration for SHA
- Added hash-only AEAD algorithms in caam
- Removed tegra driver as it is not functioning and the hardware is
too slow
- Allow blkcipher walks over AEAD (needed for ARM)
- Fixed unprotected FPU/SSE access in ghash-clmulni-intel
- Fixed highmem crash in omap-sham
- Add (zero entropy) randomness when initialising hardware RNGs
- Fixed unaligned ahash comletion functions
- Added soft module depedency for crc32c for initrds that use crc32c"
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (60 commits)
crypto: ghash-clmulni-intel - use C implementation for setkey()
crypto: x86/sha1 - reduce size of the AVX2 asm implementation
crypto: x86/sha1 - fix stack alignment of AVX2 variant
crypto: x86/sha1 - re-enable the AVX variant
crypto: sha - SHA1 transform x86_64 AVX2
crypto: crypto_wq - Fix late crypto work queue initialization
crypto: caam - add missing key_dma unmap
crypto: caam - add support for aead null encryption
crypto: testmgr - add aead null encryption test vectors
crypto: export NULL algorithms defines
crypto: caam - remove error propagation handling
crypto: hash - Simplify the ahash_finup implementation
crypto: hash - Pull out the functions to save/restore request
crypto: hash - Fix the pointer voodoo in unaligned ahash
crypto: caam - Fix first parameter to caam_init_rng
crypto: omap-sham - Map SG pages if they are HIGHMEM before accessing
crypto: caam - Dynamic memory allocation for caam_rng_ctx object
crypto: allow blkcipher walks over AEAD data
crypto: remove direct blkcipher_walk dependency on transform
hwrng: add randomness to system from rng sources
...
Diffstat (limited to 'drivers/char/hw_random/atmel-rng.c')
-rw-r--r-- | drivers/char/hw_random/atmel-rng.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c index bf9fc6b79328..851bc7e20ad2 100644 --- a/drivers/char/hw_random/atmel-rng.c +++ b/drivers/char/hw_random/atmel-rng.c | |||
@@ -54,29 +54,22 @@ static int atmel_trng_probe(struct platform_device *pdev) | |||
54 | struct resource *res; | 54 | struct resource *res; |
55 | int ret; | 55 | int ret; |
56 | 56 | ||
57 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
58 | if (!res) | ||
59 | return -EINVAL; | ||
60 | |||
61 | trng = devm_kzalloc(&pdev->dev, sizeof(*trng), GFP_KERNEL); | 57 | trng = devm_kzalloc(&pdev->dev, sizeof(*trng), GFP_KERNEL); |
62 | if (!trng) | 58 | if (!trng) |
63 | return -ENOMEM; | 59 | return -ENOMEM; |
64 | 60 | ||
65 | if (!devm_request_mem_region(&pdev->dev, res->start, | 61 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
66 | resource_size(res), pdev->name)) | 62 | trng->base = devm_ioremap_resource(&pdev->dev, res); |
67 | return -EBUSY; | 63 | if (IS_ERR(trng->base)) |
68 | 64 | return PTR_ERR(trng->base); | |
69 | trng->base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); | ||
70 | if (!trng->base) | ||
71 | return -EBUSY; | ||
72 | 65 | ||
73 | trng->clk = clk_get(&pdev->dev, NULL); | 66 | trng->clk = devm_clk_get(&pdev->dev, NULL); |
74 | if (IS_ERR(trng->clk)) | 67 | if (IS_ERR(trng->clk)) |
75 | return PTR_ERR(trng->clk); | 68 | return PTR_ERR(trng->clk); |
76 | 69 | ||
77 | ret = clk_enable(trng->clk); | 70 | ret = clk_enable(trng->clk); |
78 | if (ret) | 71 | if (ret) |
79 | goto err_enable; | 72 | return ret; |
80 | 73 | ||
81 | writel(TRNG_KEY | 1, trng->base + TRNG_CR); | 74 | writel(TRNG_KEY | 1, trng->base + TRNG_CR); |
82 | trng->rng.name = pdev->name; | 75 | trng->rng.name = pdev->name; |
@@ -92,9 +85,6 @@ static int atmel_trng_probe(struct platform_device *pdev) | |||
92 | 85 | ||
93 | err_register: | 86 | err_register: |
94 | clk_disable(trng->clk); | 87 | clk_disable(trng->clk); |
95 | err_enable: | ||
96 | clk_put(trng->clk); | ||
97 | |||
98 | return ret; | 88 | return ret; |
99 | } | 89 | } |
100 | 90 | ||
@@ -106,7 +96,6 @@ static int atmel_trng_remove(struct platform_device *pdev) | |||
106 | 96 | ||
107 | writel(TRNG_KEY, trng->base + TRNG_CR); | 97 | writel(TRNG_KEY, trng->base + TRNG_CR); |
108 | clk_disable(trng->clk); | 98 | clk_disable(trng->clk); |
109 | clk_put(trng->clk); | ||
110 | 99 | ||
111 | return 0; | 100 | return 0; |
112 | } | 101 | } |