dmaengine: at_xdma: handle errors of at_xdmac_alloc_desc() correctly

It seems that it is valid to have less than the requested number of
descriptors. But what is not valid and leads to subsequent errors is to
have zero descriptors. In that case, abort the probing.

Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
Signed-off-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20220526135111.1470926-1-michael@walle.cc
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by Michael Walle and committed by Vinod Koul 3770d92b 09f7b80f

+5
+5
drivers/dma/at_xdmac.c
··· 1900 1900 for (i = 0; i < init_nr_desc_per_channel; i++) { 1901 1901 desc = at_xdmac_alloc_desc(chan, GFP_KERNEL); 1902 1902 if (!desc) { 1903 + if (i == 0) { 1904 + dev_warn(chan2dev(chan), 1905 + "can't allocate any descriptors\n"); 1906 + return -EIO; 1907 + } 1903 1908 dev_warn(chan2dev(chan), 1904 1909 "only %d descriptors have been allocated\n", i); 1905 1910 break;