Skip to content

Commit

Permalink
ASoC: Intel: sof_es8336: get codec device with ACPI instead of bus se…
Browse files Browse the repository at this point in the history
…arch

We have an existing 'adev' handle from which we can find the codec
device, no need for an I2C bus search.

This change aligns this driver will all other I2S-based machine
drivers.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
plbossart authored and broonie committed Mar 9, 2022
1 parent 5a6cfba commit 42302b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/intel/boards/sof_es8336.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,10 @@ static int sof_es8336_probe(struct platform_device *pdev)
return ret;

/* get speaker enable GPIO */
codec_dev = bus_find_device_by_name(&i2c_bus_type, NULL, codec_name);
codec_dev = acpi_get_first_physical_node(adev);
if (!codec_dev)
return -EPROBE_DEFER;
priv->codec_dev = get_device(codec_dev);

ret = devm_acpi_dev_add_driver_gpios(codec_dev, gpio_mapping);
if (ret)
Expand All @@ -530,7 +531,6 @@ static int sof_es8336_probe(struct platform_device *pdev)
goto err;
}

priv->codec_dev = codec_dev;
INIT_LIST_HEAD(&priv->hdmi_pcm_list);

snd_soc_card_set_drvdata(card, priv);
Expand Down

0 comments on commit 42302b2

Please sign in to comment.