Skip to content

Commit

Permalink
dma: sh: Don't use ENODEV for failing slave lookup
Browse files Browse the repository at this point in the history
If dmaengine driver's .device_alloc_chan_resources() method returns -ENODEV,
dma_request_channel() will decide, that the driver has been removed and will
remove the device from its list. To prevent this use ENXIO if a slave lookup
fails.

Reported-by: Kuninori Morimoto <[email protected]>
Signed-off-by: Guennadi Liakhovetski <[email protected]>
Cc: [email protected]
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
lyakh authored and Vinod Koul committed Jan 8, 2013
1 parent 944ea4d commit 7c1119b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma/sh/shdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ static int sh_dmae_set_slave(struct shdma_chan *schan,
shdma_chan);
const struct sh_dmae_slave_config *cfg = dmae_find_slave(sh_chan, slave_id);
if (!cfg)
return -ENODEV;
return -ENXIO;

if (!try)
sh_chan->config = cfg;
Expand Down

0 comments on commit 7c1119b

Please sign in to comment.