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-sha - 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
db28512f 62f72cbd

+7 -32
+7 -32
drivers/crypto/atmel-sha.c
··· 2608 2608 return err; 2609 2609 } 2610 2610 2611 - static bool atmel_sha_filter(struct dma_chan *chan, void *slave) 2612 - { 2613 - struct at_dma_slave *sl = slave; 2614 - 2615 - if (sl && sl->dma_dev == chan->device->dev) { 2616 - chan->private = sl; 2617 - return true; 2618 - } else { 2619 - return false; 2620 - } 2621 - } 2622 - 2623 2611 static int atmel_sha_dma_init(struct atmel_sha_dev *dd, 2624 2612 struct crypto_platform_data *pdata) 2625 2613 { 2626 - dma_cap_mask_t mask_in; 2614 + dd->dma_lch_in.chan = dma_request_chan(dd->dev, "tx"); 2615 + if (IS_ERR(dd->dma_lch_in.chan)) { 2616 + int ret = PTR_ERR(dd->dma_lch_in.chan); 2627 2617 2628 - /* Try to grab DMA channel */ 2629 - dma_cap_zero(mask_in); 2630 - dma_cap_set(DMA_SLAVE, mask_in); 2631 - 2632 - dd->dma_lch_in.chan = dma_request_slave_channel_compat(mask_in, 2633 - atmel_sha_filter, &pdata->dma_slave->rxdata, dd->dev, "tx"); 2634 - if (!dd->dma_lch_in.chan) { 2635 - dev_warn(dd->dev, "no DMA channel available\n"); 2636 - return -ENODEV; 2618 + if (ret != -EPROBE_DEFER) 2619 + dev_warn(dd->dev, "no DMA channel available\n"); 2620 + return ret; 2637 2621 } 2638 2622 2639 2623 dd->dma_lch_in.dma_conf.direction = DMA_MEM_TO_DEV; ··· 2706 2722 2707 2723 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 2708 2724 if (!pdata) 2709 - return ERR_PTR(-ENOMEM); 2710 - 2711 - pdata->dma_slave = devm_kzalloc(&pdev->dev, 2712 - sizeof(*(pdata->dma_slave)), 2713 - GFP_KERNEL); 2714 - if (!pdata->dma_slave) 2715 2725 return ERR_PTR(-ENOMEM); 2716 2726 2717 2727 return pdata; ··· 2801 2823 goto iclk_unprepare; 2802 2824 } 2803 2825 } 2804 - if (!pdata->dma_slave) { 2805 - err = -ENXIO; 2806 - goto iclk_unprepare; 2807 - } 2826 + 2808 2827 err = atmel_sha_dma_init(sha_dd, pdata); 2809 2828 if (err) 2810 2829 goto err_sha_dma;