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
2121 #include <linux/platform_device.h>
2222
2323 #include <linux/device.h>
24+#include <linux/dmaengine.h>
2425 #include <linux/init.h>
2526 #include <linux/errno.h>
2627 #include <linux/interrupt.h>
@@ -37,7 +38,6 @@ · 10 unmodified lines
3738 #include <crypto/xts.h>
3839 #include <crypto/internal/aead.h>
3940 #include <crypto/internal/skcipher.h>
40−#include <linux/platform_data/crypto-atmel.h>
4141 #include "atmel-aes-regs.h"
4242 #include "atmel-authenc.h"
4343
@@ -2479,45 +2479,15 @@ static const struct of_device_id atmel_aes_dt_ids[] = { · 2435 unmodified lines
24792479 { /* sentinel */ }
24802480 };
24812481 MODULE_DEVICE_TABLE(of, atmel_aes_dt_ids);
2482−
2483−static 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
2500−static inline struct crypto_platform_data *atmel_aes_of_init(struct platform_device *pdev)
2501−{
2502− return ERR_PTR(-EINVAL);
2503−}
25042482 #endif
25052483
25062484 static int atmel_aes_probe(struct platform_device *pdev)
25072485 {
25082486 struct atmel_aes_dev *aes_dd;
2509− struct crypto_platform_data *pdata;
25102487 struct device *dev = &pdev->dev;
25112488 struct resource *aes_res;
25122489 int err;
25132490
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−
25212491 aes_dd = devm_kzalloc(&pdev->dev, sizeof(*aes_dd), GFP_KERNEL);
25222492 if (!aes_dd)
25232493 return -ENOMEM;
drivers/crypto/atmel-sha.c+1−34
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/platform_device.h>
2222
2323 #include <linux/device.h>
24+#include <linux/dmaengine.h>
2425 #include <linux/init.h>
2526 #include <linux/errno.h>
2627 #include <linux/interrupt.h>
@@ -36,7 +37,6 @@ · 9 unmodified lines
3637 #include <crypto/sha.h>
3738 #include <crypto/hash.h>
3839 #include <crypto/internal/hash.h>
39−#include <linux/platform_data/crypto-atmel.h>
4040 #include "atmel-sha-regs.h"
4141 #include "atmel-authenc.h"
4242
@@ -2551,34 +2551,11 @@ static const struct of_device_id atmel_sha_dt_ids[] = { · 2508 unmodified lines
25512551 };
25522552
25532553 MODULE_DEVICE_TABLE(of, atmel_sha_dt_ids);
2554−
2555−static 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 */
2572−static inline struct crypto_platform_data *atmel_sha_of_init(struct platform_device *dev)
2573−{
2574− return ERR_PTR(-EINVAL);
2575−}
25762554 #endif
25772555
25782556 static int atmel_sha_probe(struct platform_device *pdev)
25792557 {
25802558 struct atmel_sha_dev *sha_dd;
2581− struct crypto_platform_data *pdata;
25822559 struct device *dev = &pdev->dev;
25832560 struct resource *sha_res;
25842561 int err;
@@ -2650,16 +2627,6 @@ static int atmel_sha_probe(struct platform_device *pdev) · 65 unmodified lines
26502627 atmel_sha_get_cap(sha_dd);
26512628
26522629 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−
26632630 err = atmel_sha_dma_init(sha_dd);
26642631 if (err)
26652632 goto err_iclk_unprepare;
drivers/crypto/atmel-tdes.c+1−34
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/platform_device.h>
2222
2323 #include <linux/device.h>
24+#include <linux/dmaengine.h>
2425 #include <linux/init.h>
2526 #include <linux/errno.h>
2627 #include <linux/interrupt.h>
@@ -34,7 +35,6 @@ · 7 unmodified lines
3435 #include <crypto/algapi.h>
3536 #include <crypto/internal/des.h>
3637 #include <crypto/internal/skcipher.h>
37−#include <linux/platform_data/crypto-atmel.h>
3838 #include "atmel-tdes-regs.h"
3939
4040 #define ATMEL_TDES_PRIORITY 300
@@ -1157,34 +1157,11 @@ static const struct of_device_id atmel_tdes_dt_ids[] = { · 1116 unmodified lines
11571157 { /* sentinel */ }
11581158 };
11591159 MODULE_DEVICE_TABLE(of, atmel_tdes_dt_ids);
1160−
1161−static 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 */
1178−static inline struct crypto_platform_data *atmel_tdes_of_init(struct platform_device *pdev)
1179−{
1180− return ERR_PTR(-EINVAL);
1181−}
11821160 #endif
11831161
11841162 static int atmel_tdes_probe(struct platform_device *pdev)
11851163 {
11861164 struct atmel_tdes_dev *tdes_dd;
1187− struct crypto_platform_data *pdata;
11881165 struct device *dev = &pdev->dev;
11891166 struct resource *tdes_res;
11901167 int err;
@@ -1256,16 +1233,6 @@ static int atmel_tdes_probe(struct platform_device *pdev) · 65 unmodified lines
12561233 goto err_tasklet_kill;
12571234
12581235 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−
12691236 err = atmel_tdes_dma_init(tdes_dd);
12701237 if (err)
12711238 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− */
10−struct 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− */
19−struct crypto_platform_data {
20− struct crypto_dma_data *dma_slave;
21−};
22−
23−#endif /* __LINUX_CRYPTO_ATMEL_H */