Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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()")

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Tudor Ambarus and committed by
Herbert Xu
b46f36c0 41419a28

+3 -122
+1 -31
drivers/crypto/atmel-aes.c
··· 21 21 #include <linux/platform_device.h> 22 22 23 23 #include <linux/device.h> 24 + #include <linux/dmaengine.h> 24 25 #include <linux/init.h> 25 26 #include <linux/errno.h> 26 27 #include <linux/interrupt.h> ··· 38 37 #include <crypto/xts.h> 39 38 #include <crypto/internal/aead.h> 40 39 #include <crypto/internal/skcipher.h> 41 - #include <linux/platform_data/crypto-atmel.h> 42 40 #include "atmel-aes-regs.h" 43 41 #include "atmel-authenc.h" 44 42 ··· 2479 2479 { /* sentinel */ } 2480 2480 }; 2481 2481 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 - } 2504 2482 #endif 2505 2483 2506 2484 static int atmel_aes_probe(struct platform_device *pdev) 2507 2485 { 2508 2486 struct atmel_aes_dev *aes_dd; 2509 - struct crypto_platform_data *pdata; 2510 2487 struct device *dev = &pdev->dev; 2511 2488 struct resource *aes_res; 2512 2489 int err; 2513 - 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 2490 2521 2491 aes_dd = devm_kzalloc(&pdev->dev, sizeof(*aes_dd), GFP_KERNEL); 2522 2492 if (!aes_dd)
+1 -34
drivers/crypto/atmel-sha.c
··· 21 21 #include <linux/platform_device.h> 22 22 23 23 #include <linux/device.h> 24 + #include <linux/dmaengine.h> 24 25 #include <linux/init.h> 25 26 #include <linux/errno.h> 26 27 #include <linux/interrupt.h> ··· 37 36 #include <crypto/sha.h> 38 37 #include <crypto/hash.h> 39 38 #include <crypto/internal/hash.h> 40 - #include <linux/platform_data/crypto-atmel.h> 41 39 #include "atmel-sha-regs.h" 42 40 #include "atmel-authenc.h" 43 41 ··· 2551 2551 }; 2552 2552 2553 2553 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 - } 2576 2554 #endif 2577 2555 2578 2556 static int atmel_sha_probe(struct platform_device *pdev) 2579 2557 { 2580 2558 struct atmel_sha_dev *sha_dd; 2581 - struct crypto_platform_data *pdata; 2582 2559 struct device *dev = &pdev->dev; 2583 2560 struct resource *sha_res; 2584 2561 int err; ··· 2627 2650 atmel_sha_get_cap(sha_dd); 2628 2651 2629 2652 if (sha_dd->caps.has_dma) { 2630 - pdata = pdev->dev.platform_data; 2631 - if (!pdata) { 2632 - pdata = atmel_sha_of_init(pdev); 2633 - if (IS_ERR(pdata)) { 2634 - dev_err(&pdev->dev, "platform data not available\n"); 2635 - err = PTR_ERR(pdata); 2636 - goto err_iclk_unprepare; 2637 - } 2638 - } 2639 - 2640 2653 err = atmel_sha_dma_init(sha_dd); 2641 2654 if (err) 2642 2655 goto err_iclk_unprepare;
+1 -34
drivers/crypto/atmel-tdes.c
··· 21 21 #include <linux/platform_device.h> 22 22 23 23 #include <linux/device.h> 24 + #include <linux/dmaengine.h> 24 25 #include <linux/init.h> 25 26 #include <linux/errno.h> 26 27 #include <linux/interrupt.h> ··· 35 34 #include <crypto/algapi.h> 36 35 #include <crypto/internal/des.h> 37 36 #include <crypto/internal/skcipher.h> 38 - #include <linux/platform_data/crypto-atmel.h> 39 37 #include "atmel-tdes-regs.h" 40 38 41 39 #define ATMEL_TDES_PRIORITY 300 ··· 1157 1157 { /* sentinel */ } 1158 1158 }; 1159 1159 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 - } 1182 1160 #endif 1183 1161 1184 1162 static int atmel_tdes_probe(struct platform_device *pdev) 1185 1163 { 1186 1164 struct atmel_tdes_dev *tdes_dd; 1187 - struct crypto_platform_data *pdata; 1188 1165 struct device *dev = &pdev->dev; 1189 1166 struct resource *tdes_res; 1190 1167 int err; ··· 1233 1256 goto err_tasklet_kill; 1234 1257 1235 1258 if (tdes_dd->caps.has_dma) { 1236 - pdata = pdev->dev.platform_data; 1237 - if (!pdata) { 1238 - pdata = atmel_tdes_of_init(pdev); 1239 - if (IS_ERR(pdata)) { 1240 - dev_err(&pdev->dev, "platform data not available\n"); 1241 - err = PTR_ERR(pdata); 1242 - goto err_buff_cleanup; 1243 - } 1244 - } 1245 - 1246 1259 err = atmel_tdes_dma_init(tdes_dd); 1247 1260 if (err) 1248 1261 goto err_buff_cleanup;
-23
include/linux/platform_data/crypto-atmel.h
··· 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 */