ASoC: sh: rz-ssi: Improve error handling in rz_ssi_dma_request function
authorBiju Das <biju.das.jz@bp.renesas.com>
Wed, 18 Aug 2021 10:14:50 +0000 (11:14 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 19 Aug 2021 17:21:22 +0000 (18:21 +0100)
commit4b14f17912052a6963580dfba04781cfe6ccba02
treeaeb270415d3981a192fbd072bd9d38218a1d1e3a
parent2fbbcffea5b6adbfe90ffc842a6b3eb2d7e381ed
ASoC: sh: rz-ssi: Improve error handling in rz_ssi_dma_request function

dma_request_chan() returns error pointer in case of failures, but
the rz_ssi_dma_request() checked for NULL pointer instead.

This patch fixes the issue by checking for ERR_PTR() instead of
NULL and sets the DMA pointers to NULL in error case so that ssi
can fallback to PIO mode.

Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20210818101450.15948-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rz-ssi.c