[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5h628lu0q9.wl%tiwai@suse.de>
Date: Tue, 14 Aug 2012 14:17:18 +0200
From: Takashi Iwai <tiwai@...e.de>
To: Lee Jones <lee.jones@...aro.org>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
alsa-devel@...a-project.org, linus.walleij@...ricsson.com,
arnd@...db.de, broonie@...nsource.wolfsonmicro.com,
STEricsson_nomadik_linux@...t.st.com
Subject: Re: [alsa-devel] [PATCH 08/22] ASoC: codecs: Enable AB8500 CODEC for Device Tree
At Thu, 9 Aug 2012 16:47:34 +0100,
Lee Jones wrote:
> @@ -2407,6 +2464,30 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec)
> /* Setup AB8500 according to board-settings */
> pdata = (struct ab8500_platform_data *)dev_get_platdata(dev->parent);
>
> + if (np) {
> + if (!pdata)
> + pdata = devm_kzalloc(dev,
> + sizeof(struct ab8500_platform_data),
> + GFP_KERNEL);
> +
> + if (!pdata->codec)
The NULL check of pdata must be before pdata->codec access.
Takashi
> + pdata->codec
> + = devm_kzalloc(dev,
> + sizeof(struct ab8500_codec_platform_data),
> + GFP_KERNEL);
> +
> + if (!(pdata && pdata->codec))
> + return -ENOMEM;
> +
> + ab8500_codec_of_probe(dev, np, pdata->codec);
> +
> + } else {
> + if (!(pdata && pdata->codec)) {
> + dev_err(dev, "No codec platform data or DT found\n");
> + return -EINVAL;
> + }
> + }
> +
> /* Inform SoC Core that we have our own I/O arrangements. */
> codec->control_data = (void *)true;
>
> --
> 1.7.9.5
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@...a-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists