[PATCH 5/6] ASoC: samsung: tm2_wm5110: check of_parse return value
Krzysztof Kozlowski
krzk at kernel.org
Mon Feb 22 18:28:33 CET 2021
On Mon, 22 Feb 2021 at 17:45, Pierre-Louis Bossart
<pierre-louis.bossart at linux.intel.com> wrote:
>
>
> >> diff --git a/sound/soc/samsung/tm2_wm5110.c b/sound/soc/samsung/tm2_wm5110.c
> >> index 9300fef9bf26..da6204248f82 100644
> >> --- a/sound/soc/samsung/tm2_wm5110.c
> >> +++ b/sound/soc/samsung/tm2_wm5110.c
> >> @@ -553,7 +553,7 @@ static int tm2_probe(struct platform_device *pdev)
> >>
> >> ret = of_parse_phandle_with_args(dev->of_node, "i2s-controller",
> >> cells_name, i, &args);
> >> - if (!args.np) {
> >> + if (ret || !args.np) {
> >
> > Only "if (ret)" because args.np won't be initialized on errors.
>
> Thanks Krzysztof for the review, I will make that change in a v2.
> But just to be clear, there's no need to test args.np then?
Correct, no need to test args.np.
Best regards,
Krzysztof
More information about the Alsa-devel
mailing list