dmaengine: sh: Remove chancnt affectations
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Thu, 16 Oct 2014 09:01:01 +0000 (11:01 +0200)
committerVinod Koul <vinod.koul@intel.com>
Thu, 6 Nov 2014 06:03:07 +0000 (11:33 +0530)
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: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/sh/rcar-audmapp.c
drivers/dma/sh/rcar-hpbdma.c
drivers/dma/sh/shdma-base.c
drivers/dma/sh/shdmac.c
drivers/dma/sh/sudmac.c

index 80fd2aeb4870f07f78214e2c554181d7bb6bc16d..3db6be7d7c282fb629cdf9e18a74104a1842b48c 100644 (file)
@@ -253,7 +253,6 @@ static int audmapp_chan_probe(struct platform_device *pdev,
 
 static void audmapp_chan_remove(struct audmapp_device *audev)
 {
-       struct dma_device *dma_dev = &audev->shdma_dev.dma_dev;
        struct shdma_chan *schan;
        int i;
 
@@ -261,7 +260,6 @@ static void audmapp_chan_remove(struct audmapp_device *audev)
                BUG_ON(!schan);
                shdma_chan_remove(schan);
        }
-       dma_dev->chancnt = 0;
 }
 
 static struct dma_chan *audmapp_of_xlate(struct of_phandle_args *dma_spec,
index b212d9471ab5a55bd386a04678530fe8efa5ed66..5ab921865ffedec9af0334cddcc7d7846412a277 100644 (file)
@@ -619,7 +619,6 @@ error:
 
 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;
        int i;
 
@@ -628,7 +627,6 @@ static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev)
 
                shdma_chan_remove(schan);
        }
-       dma_dev->chancnt = 0;
 }
 
 static int hpb_dmae_remove(struct platform_device *pdev)
index 42d49741619672b34147d2741d457365533c15f4..ed5b0993edfa794c0bd477a07dd74386aeb3554a 100644 (file)
@@ -951,7 +951,7 @@ void shdma_chan_probe(struct shdma_dev *sdev,
        /* Add the channel to DMA device channel list */
        list_add_tail(&schan->dma_chan.device_node,
                        &sdev->dma_dev.channels);
-       sdev->schan[sdev->dma_dev.chancnt++] = schan;
+       sdev->schan[id] = schan;
 }
 EXPORT_SYMBOL(shdma_chan_probe);
 
index 58eb85770eba8e07e16b9dab1da321bf318369e3..b65317c6ea4e722c1958d9d82525914d68c3b223 100644 (file)
@@ -572,7 +572,6 @@ err_no_irq:
 
 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;
        int i;
 
@@ -581,7 +580,6 @@ static void sh_dmae_chan_remove(struct sh_dmae_device *shdev)
 
                shdma_chan_remove(schan);
        }
-       dma_dev->chancnt = 0;
 }
 
 static void sh_dmae_shutdown(struct platform_device *pdev)
index 3ce103909896b6202ea7bd75b79988005540dc7e..69a5c7b87ee0678c3dbf1ad68ab6aea92a916825 100644 (file)
@@ -295,7 +295,6 @@ err_no_irq:
 
 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;
        int i;
 
@@ -304,7 +303,6 @@ static void sudmac_chan_remove(struct sudmac_device *su_dev)
 
                shdma_chan_remove(schan);
        }
-       dma_dev->chancnt = 0;
 }
 
 static dma_addr_t sudmac_slave_addr(struct shdma_chan *schan)
This page took 0.029373 seconds and 5 git commands to generate.