diff options
Diffstat (limited to 'drivers/crypto/talitos.c')
-rw-r--r-- | drivers/crypto/talitos.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index ebbae8d3ce0d..20ae97a919df 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c | |||
@@ -2706,20 +2706,16 @@ static int talitos_probe(struct platform_device *ofdev) | |||
2706 | goto err_out; | 2706 | goto err_out; |
2707 | } | 2707 | } |
2708 | 2708 | ||
2709 | priv->fifo_len = roundup_pow_of_two(priv->chfifo_len); | ||
2710 | |||
2709 | for (i = 0; i < priv->num_channels; i++) { | 2711 | for (i = 0; i < priv->num_channels; i++) { |
2710 | priv->chan[i].reg = priv->reg + TALITOS_CH_STRIDE * (i + 1); | 2712 | priv->chan[i].reg = priv->reg + TALITOS_CH_STRIDE * (i + 1); |
2711 | if (!priv->irq[1] || !(i & 1)) | 2713 | if (!priv->irq[1] || !(i & 1)) |
2712 | priv->chan[i].reg += TALITOS_CH_BASE_OFFSET; | 2714 | priv->chan[i].reg += TALITOS_CH_BASE_OFFSET; |
2713 | } | ||
2714 | 2715 | ||
2715 | for (i = 0; i < priv->num_channels; i++) { | ||
2716 | spin_lock_init(&priv->chan[i].head_lock); | 2716 | spin_lock_init(&priv->chan[i].head_lock); |
2717 | spin_lock_init(&priv->chan[i].tail_lock); | 2717 | spin_lock_init(&priv->chan[i].tail_lock); |
2718 | } | ||
2719 | 2718 | ||
2720 | priv->fifo_len = roundup_pow_of_two(priv->chfifo_len); | ||
2721 | |||
2722 | for (i = 0; i < priv->num_channels; i++) { | ||
2723 | priv->chan[i].fifo = kzalloc(sizeof(struct talitos_request) * | 2719 | priv->chan[i].fifo = kzalloc(sizeof(struct talitos_request) * |
2724 | priv->fifo_len, GFP_KERNEL); | 2720 | priv->fifo_len, GFP_KERNEL); |
2725 | if (!priv->chan[i].fifo) { | 2721 | if (!priv->chan[i].fifo) { |
@@ -2727,11 +2723,10 @@ static int talitos_probe(struct platform_device *ofdev) | |||
2727 | err = -ENOMEM; | 2723 | err = -ENOMEM; |
2728 | goto err_out; | 2724 | goto err_out; |
2729 | } | 2725 | } |
2730 | } | ||
2731 | 2726 | ||
2732 | for (i = 0; i < priv->num_channels; i++) | ||
2733 | atomic_set(&priv->chan[i].submit_count, | 2727 | atomic_set(&priv->chan[i].submit_count, |
2734 | -(priv->chfifo_len - 1)); | 2728 | -(priv->chfifo_len - 1)); |
2729 | } | ||
2735 | 2730 | ||
2736 | dma_set_mask(dev, DMA_BIT_MASK(36)); | 2731 | dma_set_mask(dev, DMA_BIT_MASK(36)); |
2737 | 2732 | ||