[PATCH] ASoC: Match DT helper types
Mark Brown
broonie at kernel.org
Sat Jun 13 17:00:00 PDT 2026
On Fri, Jun 12, 2026 at 04:49:02PM -0500, Rob Herring (Arm) wrote:
> The affected ASoC drivers read properties whose bindings use boolean
> flags, normal uint32 cells, or phandle-style arrays. Using helpers for
> a different encoding makes those accesses disagree with the binding.
> Use helpers that match the documented encoding and keep the existing
> driver storage by copying through temporary values where needed.
This feels like it would be easier to deal with as separate commits for
each issue...
> --- a/sound/soc/rockchip/rockchip_pdm.c
> +++ b/sound/soc/rockchip/rockchip_pdm.c
> @@ -546,8 +546,7 @@ static int rockchip_pdm_path_parse(struct rk_pdm_dev *pdm, struct device_node *n
> unsigned int path[PDM_PATH_MAX];
> int cnt = 0, ret = 0, i = 0, val = 0, msk = 0;
>
> - cnt = of_count_phandle_with_args(node, "rockchip,path-map",
> - NULL);
> + cnt = of_property_count_u32_elems(node, "rockchip,path-map");
> if (cnt != PDM_PATH_MAX)
> return cnt;
The error codes reported by these two functions for missing properties
differ (-ENOENT vs -EINVAL) and the caller of this function has a
specific check for -ENOENT which allows it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260614/cdde39dc/attachment.sig>
More information about the linux-arm-kernel
mailing list