Re: [PATCH 2/2] ASoC: spacemit: init *dp to NULL before error paths
"Troy Mitchell" <[email protected]> Sun, 02 Aug 2026 23:38:33 -0700
| Newsgroups | dev.linux.lists.spacemit,org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound |
|---|---|
| Message-ID | <[email protected]> |
--a949f4f959a9e9c73ede8a4278dba00f3ef3605053293f1a8c4444af32a1
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
> However, unlike the Rockchip driver, spacemit_i2s_dai already has most
> of the playback
> and capture capabilities initialized statically. As a result,
> spacemit_i2s_init_dai() ends up
> assigning the same values again, for example channels_min, channels_max,
> rates,
> and formats, which seems redundant.
>
> If you think that makes sense, I can either remove those redundant
> assignments,
> or make it follow the Rockchip approach by keeping the static
> spacemit_i2s_dai
> minimal and initializing those fields only in spacemit_i2s_init_dai().
Nice catch. Please follow the Rockchip approach: keep the static
spacemit_i2s_dai minimal and initialize the playback and capture fields
conditionally in spacemit_i2s_init_dai().
Simply removing the assignments from spacemit_i2s_init_dai() would leave
channels_min nonzero for both directions in the static template.
snd_soc_dai_stream_valid() treats a direction with a nonzero channels_min
as supported, so the driver would continue advertising capture even for
a device with only a "tx" DMA. The binding permits such a configuration.
Please preserve rate_min and rate_max when moving the capability fields,
and send this change as a separate patch.
- Troy
--a949f4f959a9e9c73ede8a4278dba00f3ef3605053293f1a8c4444af32a1
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iIMEABYKACsWIQSL4Ay2cExaPXAQcU2YCe+A+TM0LwUCanA3aQ0caUB0cm95LXku
b3JnAAoJEJgJ74D5MzQv1GoA/RVsXEtyqcJ8RIszmDUsvLd9IgXmmHhzlEIWkd7W
P8riAQDkDsHlnhNzz31IA1D0iHM2d+mqgfvD61Dyns2CnOZ3Bw==
=zb68
-----END PGP SIGNATURE-----
--a949f4f959a9e9c73ede8a4278dba00f3ef3605053293f1a8c4444af32a1--