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

Configure Feed

Select the types of activity you want to include in your feed.

crypto: atmel-aes - Retire dma_request_slave_channel_compat()

The driver no longer boots in legacy mode, only via DT. This makes the
dma_request_slave_channel_compat() redundant.
If ever the filter function would be executed it will return false as the
dma_slave is not really initialized.

Switch to use dma_request_chan() which would allow legacy boot if ever
needed again by configuring dma_slave_map for the DMA driver.

At the same time skip allocating memory for dma_slave as it is not used
anymore.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Peter Ujfalusi and committed by
Herbert Xu
62f72cbd 2452cfdf

+10 -40
+10 -40
drivers/crypto/atmel-aes.c
··· 38 38 #include <crypto/internal/aead.h> 39 39 #include <crypto/internal/skcipher.h> 40 40 #include <linux/platform_data/crypto-atmel.h> 41 - #include <dt-bindings/dma/at91.h> 42 41 #include "atmel-aes-regs.h" 43 42 #include "atmel-authenc.h" 44 43 ··· 2363 2364 free_page((unsigned long)dd->buf); 2364 2365 } 2365 2366 2366 - static bool atmel_aes_filter(struct dma_chan *chan, void *slave) 2367 - { 2368 - struct at_dma_slave *sl = slave; 2369 - 2370 - if (sl && sl->dma_dev == chan->device->dev) { 2371 - chan->private = sl; 2372 - return true; 2373 - } else { 2374 - return false; 2375 - } 2376 - } 2377 - 2378 2367 static int atmel_aes_dma_init(struct atmel_aes_dev *dd, 2379 2368 struct crypto_platform_data *pdata) 2380 2369 { 2381 - struct at_dma_slave *slave; 2382 - dma_cap_mask_t mask; 2383 - 2384 - dma_cap_zero(mask); 2385 - dma_cap_set(DMA_SLAVE, mask); 2370 + int ret; 2386 2371 2387 2372 /* Try to grab 2 DMA channels */ 2388 - slave = &pdata->dma_slave->rxdata; 2389 - dd->src.chan = dma_request_slave_channel_compat(mask, atmel_aes_filter, 2390 - slave, dd->dev, "tx"); 2391 - if (!dd->src.chan) 2373 + dd->src.chan = dma_request_chan(dd->dev, "tx"); 2374 + if (IS_ERR(dd->src.chan)) { 2375 + ret = PTR_ERR(dd->src.chan); 2392 2376 goto err_dma_in; 2377 + } 2393 2378 2394 - slave = &pdata->dma_slave->txdata; 2395 - dd->dst.chan = dma_request_slave_channel_compat(mask, atmel_aes_filter, 2396 - slave, dd->dev, "rx"); 2397 - if (!dd->dst.chan) 2379 + dd->dst.chan = dma_request_chan(dd->dev, "rx"); 2380 + if (IS_ERR(dd->dst.chan)) { 2381 + ret = PTR_ERR(dd->dst.chan); 2398 2382 goto err_dma_out; 2383 + } 2399 2384 2400 2385 return 0; 2401 2386 ··· 2387 2404 dma_release_channel(dd->src.chan); 2388 2405 err_dma_in: 2389 2406 dev_warn(dd->dev, "no DMA channel available\n"); 2390 - return -ENODEV; 2407 + return ret; 2391 2408 } 2392 2409 2393 2410 static void atmel_aes_dma_cleanup(struct atmel_aes_dev *dd) ··· 2575 2592 if (!pdata) 2576 2593 return ERR_PTR(-ENOMEM); 2577 2594 2578 - pdata->dma_slave = devm_kzalloc(&pdev->dev, 2579 - sizeof(*(pdata->dma_slave)), 2580 - GFP_KERNEL); 2581 - if (!pdata->dma_slave) { 2582 - devm_kfree(&pdev->dev, pdata); 2583 - return ERR_PTR(-ENOMEM); 2584 - } 2585 - 2586 2595 return pdata; 2587 2596 } 2588 2597 #else ··· 2599 2624 err = PTR_ERR(pdata); 2600 2625 goto aes_dd_err; 2601 2626 } 2602 - } 2603 - 2604 - if (!pdata->dma_slave) { 2605 - err = -ENXIO; 2606 - goto aes_dd_err; 2607 2627 } 2608 2628 2609 2629 aes_dd = devm_kzalloc(&pdev->dev, sizeof(*aes_dd), GFP_KERNEL);