dma40: use helpers for error functions