History

crypto: atmel-{aes,sha,tdes} - Retire crypto_platform_data

These drivers no longer need it as they are only probed via DT. crypto_platform_data was allocated but unused, so remove it. This is a follow up for: commit 45a536e3a7e0 ("crypto: atmel-tdes - Retire dma_request_slave_channel_compat()") commit db28512f48e2 ("crypto: atmel-sha - Retire dma_request_slave_channel_compat()") commit 62f72cbdcf02 ("crypto: atmel-aes - Retire dma_request_slave_channel_compat()")

Tudor Ambarus committed 6 years ago

Commit b46f36c1 parent 41419a24 files · +3 −122Browse files

Unified · Split

4 files
  1. drivers/crypto/atmel-aes.c +1 −31
  2. drivers/crypto/atmel-sha.c +1 −34
  3. drivers/crypto/atmel-tdes.c +1 −34
  4. include/linux/platform_data/crypto-atmel.h +0 −23
drivers/crypto/atmel-aes.c+1−31
@@ -21,6 +21,7 @@ · 20 unmodified lines
21#include <linux/platform_device.h>21#include <linux/platform_device.h>
22 22
23#include <linux/device.h>23#include <linux/device.h>
24#include <linux/dmaengine.h>
24#include <linux/init.h>25#include <linux/init.h>
25#include <linux/errno.h>26#include <linux/errno.h>
26#include <linux/interrupt.h>27#include <linux/interrupt.h>
@@ -37,7 +38,6 @@ · 10 unmodified lines
37#include <crypto/xts.h>38#include <crypto/xts.h>
38#include <crypto/internal/aead.h>39#include <crypto/internal/aead.h>
39#include <crypto/internal/skcipher.h>40#include <crypto/internal/skcipher.h>
40#include <linux/platform_data/crypto-atmel.h>
41#include "atmel-aes-regs.h"41#include "atmel-aes-regs.h"
42#include "atmel-authenc.h"42#include "atmel-authenc.h"
43 43
@@ -2479,45 +2479,15 @@ static const struct of_device_id atmel_aes_dt_ids[] = { · 2435 unmodified lines
2479 { /* sentinel */ }2479 { /* sentinel */ }
2480};2480};
2481MODULE_DEVICE_TABLE(of, atmel_aes_dt_ids);2481MODULE_DEVICE_TABLE(of, atmel_aes_dt_ids);
2482
2483static struct crypto_platform_data *atmel_aes_of_init(struct platform_device *pdev)
2484{
2485 struct device_node *np = pdev->dev.of_node;
2486 struct crypto_platform_data *pdata;
2487
2488 if (!np) {
2489 dev_err(&pdev->dev, "device node not found\n");
2490 return ERR_PTR(-EINVAL);
2491 }
2492
2493 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
2494 if (!pdata)
2495 return ERR_PTR(-ENOMEM);
2496
2497 return pdata;
2498}
2499#else
2500static inline struct crypto_platform_data *atmel_aes_of_init(struct platform_device *pdev)
2501{
2502 return ERR_PTR(-EINVAL);
2503}
2504#endif2482#endif
2505 2483
2506static int atmel_aes_probe(struct platform_device *pdev)2484static int atmel_aes_probe(struct platform_device *pdev)
2507{2485{
2508 struct atmel_aes_dev *aes_dd;2486 struct atmel_aes_dev *aes_dd;
2509 struct crypto_platform_data *pdata;
2510 struct device *dev = &pdev->dev;2487 struct device *dev = &pdev->dev;
2511 struct resource *aes_res;2488 struct resource *aes_res;
2512 int err;2489 int err;
2513 2490
2514 pdata = pdev->dev.platform_data;
2515 if (!pdata) {
2516 pdata = atmel_aes_of_init(pdev);
2517 if (IS_ERR(pdata))
2518 return PTR_ERR(pdata);
2519 }
2520
2521 aes_dd = devm_kzalloc(&pdev->dev, sizeof(*aes_dd), GFP_KERNEL);2491 aes_dd = devm_kzalloc(&pdev->dev, sizeof(*aes_dd), GFP_KERNEL);
2522 if (!aes_dd)2492 if (!aes_dd)
2523 return -ENOMEM;2493 return -ENOMEM;
drivers/crypto/atmel-sha.c+1−34
@@ -21,6 +21,7 @@ · 20 unmodified lines
21#include <linux/platform_device.h>21#include <linux/platform_device.h>
22 22
23#include <linux/device.h>23#include <linux/device.h>
24#include <linux/dmaengine.h>
24#include <linux/init.h>25#include <linux/init.h>
25#include <linux/errno.h>26#include <linux/errno.h>
26#include <linux/interrupt.h>27#include <linux/interrupt.h>
@@ -36,7 +37,6 @@ · 9 unmodified lines
36#include <crypto/sha.h>37#include <crypto/sha.h>
37#include <crypto/hash.h>38#include <crypto/hash.h>
38#include <crypto/internal/hash.h>39#include <crypto/internal/hash.h>
39#include <linux/platform_data/crypto-atmel.h>
40#include "atmel-sha-regs.h"40#include "atmel-sha-regs.h"
41#include "atmel-authenc.h"41#include "atmel-authenc.h"
42 42
@@ -2551,34 +2551,11 @@ static const struct of_device_id atmel_sha_dt_ids[] = { · 2508 unmodified lines
2551};2551};
2552 2552
2553MODULE_DEVICE_TABLE(of, atmel_sha_dt_ids);2553MODULE_DEVICE_TABLE(of, atmel_sha_dt_ids);
2554
2555static struct crypto_platform_data *atmel_sha_of_init(struct platform_device *pdev)
2556{
2557 struct device_node *np = pdev->dev.of_node;
2558 struct crypto_platform_data *pdata;
2559
2560 if (!np) {
2561 dev_err(&pdev->dev, "device node not found\n");
2562 return ERR_PTR(-EINVAL);
2563 }
2564
2565 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
2566 if (!pdata)
2567 return ERR_PTR(-ENOMEM);
2568
2569 return pdata;
2570}
2571#else /* CONFIG_OF */
2572static inline struct crypto_platform_data *atmel_sha_of_init(struct platform_device *dev)
2573{
2574 return ERR_PTR(-EINVAL);
2575}
2576#endif2554#endif
2577 2555
2578static int atmel_sha_probe(struct platform_device *pdev)2556static int atmel_sha_probe(struct platform_device *pdev)
2579{2557{
2580 struct atmel_sha_dev *sha_dd;2558 struct atmel_sha_dev *sha_dd;
2581 struct crypto_platform_data *pdata;
2582 struct device *dev = &pdev->dev;2559 struct device *dev = &pdev->dev;
2583 struct resource *sha_res;2560 struct resource *sha_res;
2584 int err;2561 int err;
@@ -2650,16 +2627,6 @@ static int atmel_sha_probe(struct platform_device *pdev) · 65 unmodified lines
2650 atmel_sha_get_cap(sha_dd);2627 atmel_sha_get_cap(sha_dd);
2651 2628
2652 if (sha_dd->caps.has_dma) {2629 if (sha_dd->caps.has_dma) {
2653 pdata = pdev->dev.platform_data;
2654 if (!pdata) {
2655 pdata = atmel_sha_of_init(pdev);
2656 if (IS_ERR(pdata)) {
2657 dev_err(&pdev->dev, "platform data not available\n");
2658 err = PTR_ERR(pdata);
2659 goto err_iclk_unprepare;
2660 }
2661 }
2662
2663 err = atmel_sha_dma_init(sha_dd);2630 err = atmel_sha_dma_init(sha_dd);
2664 if (err)2631 if (err)
2665 goto err_iclk_unprepare;2632 goto err_iclk_unprepare;
drivers/crypto/atmel-tdes.c+1−34
@@ -21,6 +21,7 @@ · 20 unmodified lines
21#include <linux/platform_device.h>21#include <linux/platform_device.h>
22 22
23#include <linux/device.h>23#include <linux/device.h>
24#include <linux/dmaengine.h>
24#include <linux/init.h>25#include <linux/init.h>
25#include <linux/errno.h>26#include <linux/errno.h>
26#include <linux/interrupt.h>27#include <linux/interrupt.h>
@@ -34,7 +35,6 @@ · 7 unmodified lines
34#include <crypto/algapi.h>35#include <crypto/algapi.h>
35#include <crypto/internal/des.h>36#include <crypto/internal/des.h>
36#include <crypto/internal/skcipher.h>37#include <crypto/internal/skcipher.h>
37#include <linux/platform_data/crypto-atmel.h>
38#include "atmel-tdes-regs.h"38#include "atmel-tdes-regs.h"
39 39
40#define ATMEL_TDES_PRIORITY 30040#define ATMEL_TDES_PRIORITY 300
@@ -1157,34 +1157,11 @@ static const struct of_device_id atmel_tdes_dt_ids[] = { · 1116 unmodified lines
1157 { /* sentinel */ }1157 { /* sentinel */ }
1158};1158};
1159MODULE_DEVICE_TABLE(of, atmel_tdes_dt_ids);1159MODULE_DEVICE_TABLE(of, atmel_tdes_dt_ids);
1160
1161static struct crypto_platform_data *atmel_tdes_of_init(struct platform_device *pdev)
1162{
1163 struct device_node *np = pdev->dev.of_node;
1164 struct crypto_platform_data *pdata;
1165
1166 if (!np) {
1167 dev_err(&pdev->dev, "device node not found\n");
1168 return ERR_PTR(-EINVAL);
1169 }
1170
1171 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
1172 if (!pdata)
1173 return ERR_PTR(-ENOMEM);
1174
1175 return pdata;
1176}
1177#else /* CONFIG_OF */
1178static inline struct crypto_platform_data *atmel_tdes_of_init(struct platform_device *pdev)
1179{
1180 return ERR_PTR(-EINVAL);
1181}
1182#endif1160#endif
1183 1161
1184static int atmel_tdes_probe(struct platform_device *pdev)1162static int atmel_tdes_probe(struct platform_device *pdev)
1185{1163{
1186 struct atmel_tdes_dev *tdes_dd;1164 struct atmel_tdes_dev *tdes_dd;
1187 struct crypto_platform_data *pdata;
1188 struct device *dev = &pdev->dev;1165 struct device *dev = &pdev->dev;
1189 struct resource *tdes_res;1166 struct resource *tdes_res;
1190 int err;1167 int err;
@@ -1256,16 +1233,6 @@ static int atmel_tdes_probe(struct platform_device *pdev) · 65 unmodified lines
1256 goto err_tasklet_kill;1233 goto err_tasklet_kill;
1257 1234
1258 if (tdes_dd->caps.has_dma) {1235 if (tdes_dd->caps.has_dma) {
1259 pdata = pdev->dev.platform_data;
1260 if (!pdata) {
1261 pdata = atmel_tdes_of_init(pdev);
1262 if (IS_ERR(pdata)) {
1263 dev_err(&pdev->dev, "platform data not available\n");
1264 err = PTR_ERR(pdata);
1265 goto err_buff_cleanup;
1266 }
1267 }
1268
1269 err = atmel_tdes_dma_init(tdes_dd);1236 err = atmel_tdes_dma_init(tdes_dd);
1270 if (err)1237 if (err)
1271 goto err_buff_cleanup;1238 goto err_buff_cleanup;
include/linux/platform_data/crypto-atmel.h+0−23
@@ -1,23 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LINUX_CRYPTO_ATMEL_H
3#define __LINUX_CRYPTO_ATMEL_H
4
5#include <linux/platform_data/dma-atmel.h>
6
7/**
8 * struct crypto_dma_data - DMA data for AES/TDES/SHA
9 */
10struct crypto_dma_data {
11 struct at_dma_slave txdata;
12 struct at_dma_slave rxdata;
13};
14
15/**
16 * struct crypto_platform_data - board-specific AES/TDES/SHA configuration
17 * @dma_slave: DMA slave interface to use in data transfers.
18 */
19struct crypto_platform_data {
20 struct crypto_dma_data *dma_slave;
21};
22
23#endif /* __LINUX_CRYPTO_ATMEL_H */