]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
dmaengine: sa11x0: Remove chancnt affectations
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Thu, 16 Oct 2014 09:01:00 +0000 (11:01 +0200)
committerVinod Koul <vinod.koul@intel.com>
Thu, 6 Nov 2014 06:02:45 +0000 (11:32 +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>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/sa11x0-dma.c

index 4b0ef043729a1dc250f53894b58ef2dac31a4f19..2329d295efb5796d237215376b17ff33fe03506e 100644 (file)
@@ -829,7 +829,6 @@ static int sa11x0_dma_init_dmadev(struct dma_device *dmadev,
 {
        unsigned i;
 
-       dmadev->chancnt = ARRAY_SIZE(chan_desc);
        INIT_LIST_HEAD(&dmadev->channels);
        dmadev->dev = dev;
        dmadev->device_alloc_chan_resources = sa11x0_dma_alloc_chan_resources;
@@ -838,7 +837,7 @@ static int sa11x0_dma_init_dmadev(struct dma_device *dmadev,
        dmadev->device_tx_status = sa11x0_dma_tx_status;
        dmadev->device_issue_pending = sa11x0_dma_issue_pending;
 
-       for (i = 0; i < dmadev->chancnt; i++) {
+       for (i = 0; i < ARRAY_SIZE(chan_desc); i++) {
                struct sa11x0_dma_chan *c;
 
                c = kzalloc(sizeof(*c), GFP_KERNEL);