Re: [PATCH] ASoC: Match DT helper types
From: Mark Brown
Date: Sat Jun 13 2026 - 20:00:46 EST
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.
Attachment:
signature.asc
Description: PGP signature