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-tdes - 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
45a536e3 db28512f

+13 -34
+13 -34
drivers/crypto/atmel-tdes.c
··· 739 739 return atmel_tdes_handle_queue(ctx->dd, req); 740 740 } 741 741 742 - static bool atmel_tdes_filter(struct dma_chan *chan, void *slave) 743 - { 744 - struct at_dma_slave *sl = slave; 745 - 746 - if (sl && sl->dma_dev == chan->device->dev) { 747 - chan->private = sl; 748 - return true; 749 - } else { 750 - return false; 751 - } 752 - } 753 - 754 742 static int atmel_tdes_dma_init(struct atmel_tdes_dev *dd, 755 743 struct crypto_platform_data *pdata) 756 744 { 757 - dma_cap_mask_t mask; 758 - 759 - dma_cap_zero(mask); 760 - dma_cap_set(DMA_SLAVE, mask); 745 + int ret; 761 746 762 747 /* Try to grab 2 DMA channels */ 763 - dd->dma_lch_in.chan = dma_request_slave_channel_compat(mask, 764 - atmel_tdes_filter, &pdata->dma_slave->rxdata, dd->dev, "tx"); 765 - if (!dd->dma_lch_in.chan) 748 + dd->dma_lch_in.chan = dma_request_chan(dd->dev, "tx"); 749 + if (IS_ERR(dd->dma_lch_in.chan)) { 750 + ret = PTR_ERR(dd->dma_lch_in.chan); 766 751 goto err_dma_in; 752 + } 767 753 768 754 dd->dma_lch_in.dma_conf.direction = DMA_MEM_TO_DEV; 769 755 dd->dma_lch_in.dma_conf.dst_addr = dd->phys_base + ··· 762 776 DMA_SLAVE_BUSWIDTH_4_BYTES; 763 777 dd->dma_lch_in.dma_conf.device_fc = false; 764 778 765 - dd->dma_lch_out.chan = dma_request_slave_channel_compat(mask, 766 - atmel_tdes_filter, &pdata->dma_slave->txdata, dd->dev, "rx"); 767 - if (!dd->dma_lch_out.chan) 779 + dd->dma_lch_out.chan = dma_request_chan(dd->dev, "rx"); 780 + if (IS_ERR(dd->dma_lch_out.chan)) { 781 + ret = PTR_ERR(dd->dma_lch_out.chan); 768 782 goto err_dma_out; 783 + } 769 784 770 785 dd->dma_lch_out.dma_conf.direction = DMA_DEV_TO_MEM; 771 786 dd->dma_lch_out.dma_conf.src_addr = dd->phys_base + ··· 784 797 err_dma_out: 785 798 dma_release_channel(dd->dma_lch_in.chan); 786 799 err_dma_in: 787 - dev_warn(dd->dev, "no DMA channel available\n"); 788 - return -ENODEV; 800 + if (ret != -EPROBE_DEFER) 801 + dev_warn(dd->dev, "no DMA channel available\n"); 802 + return ret; 789 803 } 790 804 791 805 static void atmel_tdes_dma_cleanup(struct atmel_tdes_dev *dd) ··· 1217 1229 if (!pdata) 1218 1230 return ERR_PTR(-ENOMEM); 1219 1231 1220 - pdata->dma_slave = devm_kzalloc(&pdev->dev, 1221 - sizeof(*(pdata->dma_slave)), 1222 - GFP_KERNEL); 1223 - if (!pdata->dma_slave) 1224 - return ERR_PTR(-ENOMEM); 1225 - 1226 1232 return pdata; 1227 1233 } 1228 1234 #else /* CONFIG_OF */ ··· 1310 1328 goto err_pdata; 1311 1329 } 1312 1330 } 1313 - if (!pdata->dma_slave) { 1314 - err = -ENXIO; 1315 - goto err_pdata; 1316 - } 1331 + 1317 1332 err = atmel_tdes_dma_init(tdes_dd, pdata); 1318 1333 if (err) 1319 1334 goto err_tdes_dma;