ste_dma40: Rename a jump label in d40_alloc_mask_free()
[cascardo/linux.git] / drivers / dma / ste_dma40.c
index 43f4e25..a4f965f 100644 (file)
@@ -1831,7 +1831,7 @@ static bool d40_alloc_mask_free(struct d40_phy_res *phy, bool is_src,
                phy->allocated_dst = D40_ALLOC_FREE;
                phy->allocated_src = D40_ALLOC_FREE;
                is_free = true;
-               goto out;
+               goto unlock;
        }
 
        /* Logical channel */
@@ -1847,8 +1847,7 @@ static bool d40_alloc_mask_free(struct d40_phy_res *phy, bool is_src,
 
        is_free = ((phy->allocated_src | phy->allocated_dst) ==
                   D40_ALLOC_FREE);
-
-out:
+ unlock:
        spin_unlock_irqrestore(&phy->lock, flags);
 
        return is_free;
@@ -2047,7 +2046,7 @@ static int d40_free_dma(struct d40_chan *d40c)
        res = d40_channel_execute_command(d40c, D40_DMA_STOP);
        if (res) {
                chan_err(d40c, "stop failed\n");
-               goto out;
+               goto mark_last_busy;
        }
 
        d40_alloc_mask_free(phy, is_src, chan_is_logical(d40c) ? event : 0);
@@ -2065,8 +2064,7 @@ static int d40_free_dma(struct d40_chan *d40c)
        d40c->busy = false;
        d40c->phy_chan = NULL;
        d40c->configured = false;
-out:
-
+ mark_last_busy:
        pm_runtime_mark_last_busy(d40c->base->dev);
        pm_runtime_put_autosuspend(d40c->base->dev);
        return res;
@@ -2094,8 +2092,7 @@ static bool d40_is_paused(struct d40_chan *d40c)
                        D40_CHAN_POS(d40c->phy_chan->num);
                if (status == D40_DMA_SUSPENDED || status == D40_DMA_STOP)
                        is_paused = true;
-
-               goto _exit;
+               goto unlock;
        }
 
        if (d40c->dma_cfg.dir == DMA_MEM_TO_DEV ||
@@ -2105,7 +2102,7 @@ static bool d40_is_paused(struct d40_chan *d40c)
                status = readl(chanbase + D40_CHAN_REG_SSLNK);
        } else {
                chan_err(d40c, "Unknown direction\n");
-               goto _exit;
+               goto unlock;
        }
 
        status = (status & D40_EVENTLINE_MASK(event)) >>
@@ -2113,7 +2110,7 @@ static bool d40_is_paused(struct d40_chan *d40c)
 
        if (status != D40_DMA_RUN)
                is_paused = true;
-_exit:
+ unlock:
        spin_unlock_irqrestore(&d40c->lock, flags);
        return is_paused;
 
@@ -2198,7 +2195,7 @@ static struct d40_desc *
 d40_prep_desc(struct d40_chan *chan, struct scatterlist *sg,
              unsigned int sg_len, unsigned long dma_flags)
 {
-       struct stedma40_chan_cfg *cfg = &chan->dma_cfg;
+       struct stedma40_chan_cfg *cfg;
        struct d40_desc *desc;
        int ret;
 
@@ -2206,17 +2203,18 @@ d40_prep_desc(struct d40_chan *chan, struct scatterlist *sg,
        if (!desc)
                return NULL;
 
+       cfg = &chan->dma_cfg;
        desc->lli_len = d40_sg_2_dmalen(sg, sg_len, cfg->src_info.data_width,
                                        cfg->dst_info.data_width);
        if (desc->lli_len < 0) {
                chan_err(chan, "Unaligned size\n");
-               goto err;
+               goto free_desc;
        }
 
        ret = d40_pool_lli_alloc(chan, desc, desc->lli_len);
        if (ret < 0) {
                chan_err(chan, "Could not allocate lli\n");
-               goto err;
+               goto free_desc;
        }
 
        desc->lli_current = 0;
@@ -2226,8 +2224,7 @@ d40_prep_desc(struct d40_chan *chan, struct scatterlist *sg,
        dma_async_tx_descriptor_init(&desc->txd, &chan->chan);
 
        return desc;
-
-err:
+ free_desc:
        d40_desc_free(chan, desc);
        return NULL;
 }