* [PATCH] ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check
@ 2025-01-09 18:22 Rob Herring (Arm)
2025-01-09 22:52 ` Kuninori Morimoto
2025-01-13 16:00 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Rob Herring (Arm) @ 2025-01-09 18:22 UTC (permalink / raw)
To: Mark Brown, Kuninori Morimoto, Liam Girdwood, Jaroslav Kysela,
Takashi Iwai
Cc: linux-sound, linux-kernel
It doesn't matter whether "dai-tdm-slot-width-map" is not present or
there is some other issue parsing it in of_property_count_elems_of_size()
causing an error. Drop the presence check and rely on
of_property_count_elems_of_size() error return if not present.
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
sound/soc/generic/simple-card-utils.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 91325286894e..e25b387a9776 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -139,10 +139,9 @@ int simple_util_parse_tdm_width_map(struct device *dev, struct device_node *np,
int n, i, ret;
u32 *p;
- if (!of_property_read_bool(np, "dai-tdm-slot-width-map"))
- return 0;
-
n = of_property_count_elems_of_size(np, "dai-tdm-slot-width-map", sizeof(u32));
+ if (n <= 0)
+ return 0;
if (n % 3) {
dev_err(dev, "Invalid number of cells for dai-tdm-slot-width-map\n");
return -EINVAL;
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check
2025-01-09 18:22 [PATCH] ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check Rob Herring (Arm)
@ 2025-01-09 22:52 ` Kuninori Morimoto
2025-01-13 16:00 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2025-01-09 22:52 UTC (permalink / raw)
To: Rob Herring (Arm)
Cc: Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
linux-sound, linux-kernel
Hi
> It doesn't matter whether "dai-tdm-slot-width-map" is not present or
> there is some other issue parsing it in of_property_count_elems_of_size()
> causing an error. Drop the presence check and rely on
> of_property_count_elems_of_size() error return if not present.
>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
> index 91325286894e..e25b387a9776 100644
> --- a/sound/soc/generic/simple-card-utils.c
> +++ b/sound/soc/generic/simple-card-utils.c
> @@ -139,10 +139,9 @@ int simple_util_parse_tdm_width_map(struct device *dev, struct device_node *np,
> int n, i, ret;
> u32 *p;
>
> - if (!of_property_read_bool(np, "dai-tdm-slot-width-map"))
> - return 0;
> -
> n = of_property_count_elems_of_size(np, "dai-tdm-slot-width-map", sizeof(u32));
> + if (n <= 0)
> + return 0;
> if (n % 3) {
> dev_err(dev, "Invalid number of cells for dai-tdm-slot-width-map\n");
> return -EINVAL;
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check
2025-01-09 18:22 [PATCH] ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check Rob Herring (Arm)
2025-01-09 22:52 ` Kuninori Morimoto
@ 2025-01-13 16:00 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-01-13 16:00 UTC (permalink / raw)
To: Kuninori Morimoto, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
Rob Herring (Arm)
Cc: linux-sound, linux-kernel
On Thu, 09 Jan 2025 12:22:02 -0600, Rob Herring (Arm) wrote:
> It doesn't matter whether "dai-tdm-slot-width-map" is not present or
> there is some other issue parsing it in of_property_count_elems_of_size()
> causing an error. Drop the presence check and rely on
> of_property_count_elems_of_size() error return if not present.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check
commit: abea0cbfba5848d11b6364e82df4864fd0bfa683
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-13 16:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09 18:22 [PATCH] ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check Rob Herring (Arm)
2025-01-09 22:52 ` Kuninori Morimoto
2025-01-13 16:00 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox