Commit 1e916474 authored by Maxime Ripard's avatar Maxime Ripard Committed by Vinod Koul

dmaengine: sh: Remove chancnt affectations

chanctnt is already filled by dma_async_device_register, which uses the channel
list to know how much channels there is.

Since it's already filled, we can safely remove it from the drivers' probe
function.
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 9aa71711
...@@ -253,7 +253,6 @@ static int audmapp_chan_probe(struct platform_device *pdev, ...@@ -253,7 +253,6 @@ static int audmapp_chan_probe(struct platform_device *pdev,
static void audmapp_chan_remove(struct audmapp_device *audev) static void audmapp_chan_remove(struct audmapp_device *audev)
{ {
struct dma_device *dma_dev = &audev->shdma_dev.dma_dev;
struct shdma_chan *schan; struct shdma_chan *schan;
int i; int i;
...@@ -261,7 +260,6 @@ static void audmapp_chan_remove(struct audmapp_device *audev) ...@@ -261,7 +260,6 @@ static void audmapp_chan_remove(struct audmapp_device *audev)
BUG_ON(!schan); BUG_ON(!schan);
shdma_chan_remove(schan); shdma_chan_remove(schan);
} }
dma_dev->chancnt = 0;
} }
static struct dma_chan *audmapp_of_xlate(struct of_phandle_args *dma_spec, static struct dma_chan *audmapp_of_xlate(struct of_phandle_args *dma_spec,
......
...@@ -619,7 +619,6 @@ static int hpb_dmae_probe(struct platform_device *pdev) ...@@ -619,7 +619,6 @@ static int hpb_dmae_probe(struct platform_device *pdev)
static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev) static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev)
{ {
struct dma_device *dma_dev = &hpbdev->shdma_dev.dma_dev;
struct shdma_chan *schan; struct shdma_chan *schan;
int i; int i;
...@@ -628,7 +627,6 @@ static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev) ...@@ -628,7 +627,6 @@ static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev)
shdma_chan_remove(schan); shdma_chan_remove(schan);
} }
dma_dev->chancnt = 0;
} }
static int hpb_dmae_remove(struct platform_device *pdev) static int hpb_dmae_remove(struct platform_device *pdev)
......
...@@ -951,7 +951,7 @@ void shdma_chan_probe(struct shdma_dev *sdev, ...@@ -951,7 +951,7 @@ void shdma_chan_probe(struct shdma_dev *sdev,
/* Add the channel to DMA device channel list */ /* Add the channel to DMA device channel list */
list_add_tail(&schan->dma_chan.device_node, list_add_tail(&schan->dma_chan.device_node,
&sdev->dma_dev.channels); &sdev->dma_dev.channels);
sdev->schan[sdev->dma_dev.chancnt++] = schan; sdev->schan[id] = schan;
} }
EXPORT_SYMBOL(shdma_chan_probe); EXPORT_SYMBOL(shdma_chan_probe);
......
...@@ -572,7 +572,6 @@ static int sh_dmae_chan_probe(struct sh_dmae_device *shdev, int id, ...@@ -572,7 +572,6 @@ static int sh_dmae_chan_probe(struct sh_dmae_device *shdev, int id,
static void sh_dmae_chan_remove(struct sh_dmae_device *shdev) static void sh_dmae_chan_remove(struct sh_dmae_device *shdev)
{ {
struct dma_device *dma_dev = &shdev->shdma_dev.dma_dev;
struct shdma_chan *schan; struct shdma_chan *schan;
int i; int i;
...@@ -581,7 +580,6 @@ static void sh_dmae_chan_remove(struct sh_dmae_device *shdev) ...@@ -581,7 +580,6 @@ static void sh_dmae_chan_remove(struct sh_dmae_device *shdev)
shdma_chan_remove(schan); shdma_chan_remove(schan);
} }
dma_dev->chancnt = 0;
} }
static void sh_dmae_shutdown(struct platform_device *pdev) static void sh_dmae_shutdown(struct platform_device *pdev)
......
...@@ -295,7 +295,6 @@ static int sudmac_chan_probe(struct sudmac_device *su_dev, int id, int irq, ...@@ -295,7 +295,6 @@ static int sudmac_chan_probe(struct sudmac_device *su_dev, int id, int irq,
static void sudmac_chan_remove(struct sudmac_device *su_dev) static void sudmac_chan_remove(struct sudmac_device *su_dev)
{ {
struct dma_device *dma_dev = &su_dev->shdma_dev.dma_dev;
struct shdma_chan *schan; struct shdma_chan *schan;
int i; int i;
...@@ -304,7 +303,6 @@ static void sudmac_chan_remove(struct sudmac_device *su_dev) ...@@ -304,7 +303,6 @@ static void sudmac_chan_remove(struct sudmac_device *su_dev)
shdma_chan_remove(schan); shdma_chan_remove(schan);
} }
dma_dev->chancnt = 0;
} }
static dma_addr_t sudmac_slave_addr(struct shdma_chan *schan) static dma_addr_t sudmac_slave_addr(struct shdma_chan *schan)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment