ASoC: fsl_ssi: fix kernel panic in probe function

code can raise a panic when the ssi_private->pdev is null

	 * If codec-handle property is missing from SSI node, we assume
	 * that the machine driver uses new binding which does not require
	 * SSI driver to trigger machine driver's probe.
	if (!of_get_property(np, "codec-handle", NULL))
		goto done;
	ssi_private->pdev =
		platform_device_register_data(&pdev->dev, name, 0, NULL, 0);
	if (ssi_private->dai_fmt)
		_fsl_ssi_set_dai_fmt(ssi_private, ssi_private->dai_fmt);

Proposal was to not use ssi_private->pdev->dev here but adding a new parameter
of *dev pointer to this _set_dai_fmt() -- passing pdev->dev in probe() and
cpu_dai->dev in fsl_ssi_set_dai_fmt().

Signed-off-by: Michael Trimarchi <>
Reported-by: Jean-Michel Hautbois <>
Acked-by: Nicolin Chen <>
Signed-off-by: Mark Brown <>
1 file changed