mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-12-04 23:30:56 -06:00
ASoC: ti: tidyup not to use *card on rx51_soc_probe()
struct snd_soc_card will be capsuled soon, its member will not be able to access from non soc-card.c. To reduce the difference during conversion, replace dev. - card->dev, ... + dev, ... No functional change, but is preparation for Card capsuling. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Link: https://patch.msgid.link/87ik69i0d0.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
+16
-15
@@ -358,21 +358,22 @@ static struct snd_soc_card rx51_sound_card = {
|
||||
static int rx51_soc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct rx51_audio_pdata *pdata;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
struct snd_soc_card *card = &rx51_sound_card;
|
||||
int err;
|
||||
|
||||
if (!of_machine_is_compatible("nokia,omap3-n900"))
|
||||
return -ENODEV;
|
||||
|
||||
card->dev = &pdev->dev;
|
||||
card->dev = dev;
|
||||
|
||||
if (np) {
|
||||
struct device_node *dai_node;
|
||||
|
||||
dai_node = of_parse_phandle(np, "nokia,cpu-dai", 0);
|
||||
if (!dai_node) {
|
||||
dev_err(card->dev, "McBSP node is not provided\n");
|
||||
dev_err(dev, "McBSP node is not provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
rx51_dai[0].cpus->dai_name = NULL;
|
||||
@@ -382,7 +383,7 @@ static int rx51_soc_probe(struct platform_device *pdev)
|
||||
|
||||
dai_node = of_parse_phandle(np, "nokia,audio-codec", 0);
|
||||
if (!dai_node) {
|
||||
dev_err(card->dev, "Codec node is not provided\n");
|
||||
dev_err(dev, "Codec node is not provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
rx51_dai[0].codecs->name = NULL;
|
||||
@@ -390,7 +391,7 @@ static int rx51_soc_probe(struct platform_device *pdev)
|
||||
|
||||
dai_node = of_parse_phandle(np, "nokia,audio-codec", 1);
|
||||
if (!dai_node) {
|
||||
dev_err(card->dev, "Auxiliary Codec node is not provided\n");
|
||||
dev_err(dev, "Auxiliary Codec node is not provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
rx51_aux_dev[0].dlc.name = NULL;
|
||||
@@ -400,7 +401,7 @@ static int rx51_soc_probe(struct platform_device *pdev)
|
||||
|
||||
dai_node = of_parse_phandle(np, "nokia,headphone-amplifier", 0);
|
||||
if (!dai_node) {
|
||||
dev_err(card->dev, "Headphone amplifier node is not provided\n");
|
||||
dev_err(dev, "Headphone amplifier node is not provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
rx51_aux_dev[1].dlc.name = NULL;
|
||||
@@ -409,38 +410,38 @@ static int rx51_soc_probe(struct platform_device *pdev)
|
||||
rx51_codec_conf[1].dlc.of_node = dai_node;
|
||||
}
|
||||
|
||||
pdata = devm_kzalloc(card->dev, sizeof(*pdata), GFP_KERNEL);
|
||||
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
|
||||
if (pdata == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
snd_soc_card_set_drvdata(card, pdata);
|
||||
|
||||
pdata->tvout_selection_gpio = devm_gpiod_get(card->dev,
|
||||
pdata->tvout_selection_gpio = devm_gpiod_get(dev,
|
||||
"tvout-selection",
|
||||
GPIOD_OUT_LOW);
|
||||
if (IS_ERR(pdata->tvout_selection_gpio)) {
|
||||
dev_err(card->dev, "could not get tvout selection gpio\n");
|
||||
dev_err(dev, "could not get tvout selection gpio\n");
|
||||
return PTR_ERR(pdata->tvout_selection_gpio);
|
||||
}
|
||||
|
||||
pdata->eci_sw_gpio = devm_gpiod_get(card->dev, "eci-switch",
|
||||
pdata->eci_sw_gpio = devm_gpiod_get(dev, "eci-switch",
|
||||
GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(pdata->eci_sw_gpio)) {
|
||||
dev_err(card->dev, "could not get eci switch gpio\n");
|
||||
dev_err(dev, "could not get eci switch gpio\n");
|
||||
return PTR_ERR(pdata->eci_sw_gpio);
|
||||
}
|
||||
|
||||
pdata->speaker_amp_gpio = devm_gpiod_get(card->dev,
|
||||
pdata->speaker_amp_gpio = devm_gpiod_get(dev,
|
||||
"speaker-amplifier",
|
||||
GPIOD_OUT_LOW);
|
||||
if (IS_ERR(pdata->speaker_amp_gpio)) {
|
||||
dev_err(card->dev, "could not get speaker enable gpio\n");
|
||||
dev_err(dev, "could not get speaker enable gpio\n");
|
||||
return PTR_ERR(pdata->speaker_amp_gpio);
|
||||
}
|
||||
|
||||
err = devm_snd_soc_register_card(card->dev, card);
|
||||
err = devm_snd_soc_register_card(dev, card);
|
||||
if (err) {
|
||||
dev_err(card->dev, "snd_soc_register_card failed (%d)\n", err);
|
||||
dev_err(dev, "snd_soc_register_card failed (%d)\n", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user