res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ);
if (res) {
- dev_err(&d40c->chan.dev->device, "[%s] suspend\n",
+ dev_err(&d40c->chan.dev->device, "[%s] suspend failed\n",
__func__);
return res;
}
*/
if (d40c->dma_cfg.channel_type == 0) {
err = d40_config_memcpy(d40c);
- if (err)
- goto err_alloc;
+ if (err) {
+ dev_err(&d40c->chan.dev->device,
+ "[%s] Failed to configure memcpy channel\n",
+ __func__);
+ goto fail;
+ }
}
is_free_phy = (d40c->phy_chan == NULL);
if (err) {
dev_err(&d40c->chan.dev->device,
"[%s] Failed to allocate channel\n", __func__);
- goto err_alloc;
+ goto fail;
}
/* Fill in basic CFG register values */
__func__);
}
}
-
+fail:
spin_unlock_irqrestore(&d40c->lock, flags);
- return 0;
-
- err_config:
- (void) d40_free_dma(d40c);
- err_alloc:
- spin_unlock_irqrestore(&d40c->lock, flags);
- dev_err(&d40c->chan.dev->device,
- "[%s] Channel allocation failed\n", __func__);
- return -EINVAL;
+ return err;
}
static void d40_free_chan_resources(struct dma_chan *chan)