Skip to content

Commit

Permalink
crypto: atmel - return appropriate error code
Browse files Browse the repository at this point in the history
Return -ENODEV when dma_request_slave_channel_compat() fails.

Signed-off-by: Tudor Ambarus <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ambarus authored and herbertx committed Nov 3, 2017
1 parent aba973c commit 3c88761
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions drivers/crypto/atmel-aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2383,7 +2383,6 @@ static int atmel_aes_dma_init(struct atmel_aes_dev *dd,
struct crypto_platform_data *pdata)
{
struct at_dma_slave *slave;
int err = -ENOMEM;
dma_cap_mask_t mask;

dma_cap_zero(mask);
Expand All @@ -2408,7 +2407,7 @@ static int atmel_aes_dma_init(struct atmel_aes_dev *dd,
dma_release_channel(dd->src.chan);
err_dma_in:
dev_warn(dd->dev, "no DMA channel available\n");
return err;
return -ENODEV;
}

static void atmel_aes_dma_cleanup(struct atmel_aes_dev *dd)
Expand Down
3 changes: 1 addition & 2 deletions drivers/crypto/atmel-sha.c
Original file line number Diff line number Diff line change
Expand Up @@ -2628,7 +2628,6 @@ static bool atmel_sha_filter(struct dma_chan *chan, void *slave)
static int atmel_sha_dma_init(struct atmel_sha_dev *dd,
struct crypto_platform_data *pdata)
{
int err = -ENOMEM;
dma_cap_mask_t mask_in;

/* Try to grab DMA channel */
Expand All @@ -2639,7 +2638,7 @@ static int atmel_sha_dma_init(struct atmel_sha_dev *dd,
atmel_sha_filter, &pdata->dma_slave->rxdata, dd->dev, "tx");
if (!dd->dma_lch_in.chan) {
dev_warn(dd->dev, "no DMA channel available\n");
return err;
return -ENODEV;
}

dd->dma_lch_in.dma_conf.direction = DMA_MEM_TO_DEV;
Expand Down
3 changes: 1 addition & 2 deletions drivers/crypto/atmel-tdes.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,6 @@ static bool atmel_tdes_filter(struct dma_chan *chan, void *slave)
static int atmel_tdes_dma_init(struct atmel_tdes_dev *dd,
struct crypto_platform_data *pdata)
{
int err = -ENOMEM;
dma_cap_mask_t mask;

dma_cap_zero(mask);
Expand Down Expand Up @@ -765,7 +764,7 @@ static int atmel_tdes_dma_init(struct atmel_tdes_dev *dd,
dma_release_channel(dd->dma_lch_in.chan);
err_dma_in:
dev_warn(dd->dev, "no DMA channel available\n");
return err;
return -ENODEV;
}

static void atmel_tdes_dma_cleanup(struct atmel_tdes_dev *dd)
Expand Down

0 comments on commit 3c88761

Please sign in to comment.