Commit 855e69f4 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: intel: sof_sdw: Minor tidy up of mc_probe

Shuffle things around to group operations a little more, and
consistently use card->dev.
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230731214257.444605-16-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent fad1a9ef
......@@ -1964,34 +1964,34 @@ static void mc_dailink_exit_loop(struct snd_soc_card *card)
static int mc_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &card_sof_sdw;
struct snd_soc_acpi_mach *mach;
struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev);
struct mc_private *ctx;
int amp_num = 0, i;
int ret;
dev_dbg(&pdev->dev, "Entry\n");
card->dev = &pdev->dev;
dev_dbg(card->dev, "Entry\n");
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
ctx = devm_kzalloc(card->dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
snd_soc_card_set_drvdata(card, ctx);
dmi_check_system(sof_sdw_quirk_table);
if (quirk_override != -1) {
dev_info(&pdev->dev, "Overriding quirk 0x%lx => 0x%x\n",
dev_info(card->dev, "Overriding quirk 0x%lx => 0x%x\n",
sof_sdw_quirk, quirk_override);
sof_sdw_quirk = quirk_override;
}
log_quirks(&pdev->dev);
INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
card->dev = &pdev->dev;
snd_soc_card_set_drvdata(card, ctx);
log_quirks(card->dev);
mach = pdev->dev.platform_data;
ret = sof_card_dai_links_create(&pdev->dev, mach,
card);
ret = sof_card_dai_links_create(card->dev, mach, card);
if (ret < 0)
return ret;
......@@ -2022,7 +2022,7 @@ static int mc_probe(struct platform_device *pdev)
card->long_name = sdw_card_long_name;
/* Register the card */
ret = devm_snd_soc_register_card(&pdev->dev, card);
ret = devm_snd_soc_register_card(card->dev, card);
if (ret) {
dev_err(card->dev, "snd_soc_register_card failed %d\n", ret);
mc_dailink_exit_loop(card);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment