Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: uniphier: Handle regmap_write errors in aio_iecout_set_enable()

The aio_oport_set_stream_type() function did not previously check the
return values of regmap_write().
If these functions fail, it could lead to silent failures when
configuring the audio playback port, causing improper behavior in audio
stream output via S/PDIF without any indication of an error.

This patch modifies aio_oport_set_stream_type() to check the return
values of regmap_write().
If regmap_write() fails, the error code is propagated back to the caller
to ensure proper error handling.

Signed-off-by: Ingyu Jang <ingyujang25@unist.ac.kr>
Link: https://patch.msgid.link/SE1P216MB2287962B462AE91B26248D19FD7E2@SE1P216MB2287.KORP216.PROD.OUTLOOK.COM
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Ingyu Jang and committed by
Mark Brown
9b0c6511 43aea89a

+8 -2
+8 -2
sound/soc/uniphier/aio-core.c
··· 838 838 { 839 839 struct regmap *r = sub->aio->chip->regmap; 840 840 u32 repet = 0, pause = OPORTMXPAUDAT_PAUSEPC_CMN; 841 + int ret; 841 842 842 843 switch (pc) { 843 844 case IEC61937_PC_AC3: ··· 881 880 break; 882 881 } 883 882 884 - regmap_write(r, OPORTMXREPET(sub->swm->oport.map), repet); 885 - regmap_write(r, OPORTMXPAUDAT(sub->swm->oport.map), pause); 883 + ret = regmap_write(r, OPORTMXREPET(sub->swm->oport.map), repet); 884 + if (ret) 885 + return ret; 886 + 887 + ret = regmap_write(r, OPORTMXPAUDAT(sub->swm->oport.map), pause); 888 + if (ret) 889 + return ret; 886 890 887 891 return 0; 888 892 }