Clean up the resource allocation in atc_get_resources() and related
functions, on top of the recent SPDIFI1 fixes.
The earlier refactoring introduced a kernel crash on hw20k2, where
daio_device_index() returned -EINVAL for the SPDIFI1 type and the
value was used as an unsigned array offset. On my development system
(64G memory), this did not manifest as a crash, making the bug
difficult to catch during testing.
Tested on the real hw20k2 hardware with mem=8G to verify the original
crash and confirm these patches.
Changes in v2:
- Add atc_spdif_in_type() helper to avoid ternary operators in
multiple places
- Rewrite the SPDIFI type skip condition as explicit model checks
Harin Lee (3):
ALSA: ctxfi: Rename SPDIFI1 to SPDIFI_BAY
ALSA: ctxfi: Use correct DAIO type for da_desc
ALSA: ctxfi: Precompute SRC allocation loop bound
sound/pci/ctxfi/ctatc.c | 31 ++++++++++++++++---------------
sound/pci/ctxfi/ctdaio.c | 5 ++---
sound/pci/ctxfi/ctdaio.h | 2 +-
3 files changed, 19 insertions(+), 19 deletions(-)
--
2.53.0