This addresses an issue pointed out by compiler warning:
sound/soc/samsung/odroid.c: In function ‘odroid_audio_probe’:
sound/soc/samsung/odroid.c:298:22: warning: ‘cpu_dai’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
priv->clk_i2s_bus = of_clk_get_by_name(cpu_dai, "iis");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
static int odroid_audio_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct device_node *cpu, *cpu_dai, *codec;
+ struct device_node *cpu_dai = NULL;
+ struct device_node *cpu, *codec;
struct odroid_priv *priv;
struct snd_soc_card *card;
struct snd_soc_dai_link *link, *codec_link;
if (ret < 0)
break;
}
- if (ret == 0)
+ if (ret == 0) {
cpu_dai = of_parse_phandle(cpu, "sound-dai", 0);
+ if (!cpu_dai)
+ ret = -EINVAL;
+ }
of_node_put(cpu);
of_node_put(codec);