ste_dma40: Rename a jump label in __d40_execute_command_phy()
[cascardo/linux.git] / drivers / dma / ste_dma40.c
index 55d0df9..82314b7 100644 (file)
@@ -1083,7 +1083,7 @@ static int __d40_execute_command_phy(struct d40_chan *d40c,
                        D40_CHAN_POS(d40c->phy_chan->num);
 
                if (status == D40_DMA_SUSPENDED || status == D40_DMA_STOP)
-                       goto done;
+                       goto unlock;
        }
 
        wmask = 0xffffffff & ~(D40_CHAN_POS_MASK(d40c->phy_chan->num));
@@ -1119,7 +1119,7 @@ static int __d40_execute_command_phy(struct d40_chan *d40c,
                }
 
        }
-done:
+ unlock:
        spin_unlock_irqrestore(&d40c->base->execmd_lock, flags);
        return ret;
 }
@@ -1607,7 +1607,7 @@ static void dma_tasklet(unsigned long data)
                /* Check if we have reached here for cyclic job */
                d40d = d40_first_active_get(d40c);
                if (d40d == NULL || !d40d->cyclic)
-                       goto err;
+                       goto check_pending_tx;
        }
 
        if (!d40d->cyclic)
@@ -1650,8 +1650,7 @@ static void dma_tasklet(unsigned long data)
                callback(callback_param);
 
        return;
-
-err:
+ check_pending_tx:
        /* Rescue manouver if receiving double interrupts */
        if (d40c->pending_tx > 0)
                d40c->pending_tx--;
@@ -1780,42 +1779,40 @@ static bool d40_alloc_mask_set(struct d40_phy_res *phy,
                    phy->allocated_dst == D40_ALLOC_FREE) {
                        phy->allocated_dst = D40_ALLOC_PHY;
                        phy->allocated_src = D40_ALLOC_PHY;
-                       goto found;
+                       goto found_unlock;
                } else
-                       goto not_found;
+                       goto not_found_unlock;
        }
 
        /* Logical channel */
        if (is_src) {
                if (phy->allocated_src == D40_ALLOC_PHY)
-                       goto not_found;
+                       goto not_found_unlock;
 
                if (phy->allocated_src == D40_ALLOC_FREE)
                        phy->allocated_src = D40_ALLOC_LOG_FREE;
 
                if (!(phy->allocated_src & BIT(log_event_line))) {
                        phy->allocated_src |= BIT(log_event_line);
-                       goto found;
+                       goto found_unlock;
                } else
-                       goto not_found;
+                       goto not_found_unlock;
        } else {
                if (phy->allocated_dst == D40_ALLOC_PHY)
-                       goto not_found;
+                       goto not_found_unlock;
 
                if (phy->allocated_dst == D40_ALLOC_FREE)
                        phy->allocated_dst = D40_ALLOC_LOG_FREE;
 
                if (!(phy->allocated_dst & BIT(log_event_line))) {
                        phy->allocated_dst |= BIT(log_event_line);
-                       goto found;
-               } else
-                       goto not_found;
+                       goto found_unlock;
+               }
        }
-
-not_found:
+ not_found_unlock:
        spin_unlock_irqrestore(&phy->lock, flags);
        return false;
-found:
+ found_unlock:
        spin_unlock_irqrestore(&phy->lock, flags);
        return true;
 }
@@ -1831,7 +1828,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 +1844,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 +2043,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 +2061,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;