Unverified Commit 9558ad21 authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown
Browse files

ASoC: rt5677: Use devm_snd_soc_register_component()



Using devm_snd_soc_register_component() can make the code
shorter and cleaner.

Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200507094335.14302-1-weiyongjun1@huawei.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent adb69968
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -605,7 +605,8 @@ static int rt5677_spi_probe(struct spi_device *spi)

	g_spi = spi;

	ret = snd_soc_register_component(&spi->dev, &rt5677_spi_dai_component,
	ret = devm_snd_soc_register_component(&spi->dev,
					      &rt5677_spi_dai_component,
					      &rt5677_spi_dai, 1);
	if (ret < 0)
		dev_err(&spi->dev, "Failed to register component.\n");
@@ -613,12 +614,6 @@ static int rt5677_spi_probe(struct spi_device *spi)
	return ret;
}

static int rt5677_spi_remove(struct spi_device *spi)
{
	snd_soc_unregister_component(&spi->dev);
	return 0;
}

static const struct acpi_device_id rt5677_spi_acpi_id[] = {
	{ "RT5677AA", 0 },
	{ }
@@ -631,7 +626,6 @@ static struct spi_driver rt5677_spi_driver = {
		.acpi_match_table = ACPI_PTR(rt5677_spi_acpi_id),
	},
	.probe = rt5677_spi_probe,
	.remove = rt5677_spi_remove,
};
module_spi_driver(rt5677_spi_driver);