Unverified Commit 87284832 authored by Luoxi Li's avatar Luoxi Li Committed by Mark Brown
Browse files

ASoC: use to_platform_device() instead of container_of()



Use the to_platform_device() macro where possible.

Signed-off-by: default avatarLuoxi Li <lee.lockhey@gmail.com>
Link: https://patch.msgid.link/20250123033937.3587880-1-lee.lockhey@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b9a8ea18
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1091,8 +1091,7 @@ static int rt5514_set_bias_level(struct snd_soc_component *component,
static int rt5514_probe(struct snd_soc_component *component)
{
	struct rt5514_priv *rt5514 = snd_soc_component_get_drvdata(component);
	struct platform_device *pdev = container_of(component->dev,
						   struct platform_device, dev);
	struct platform_device *pdev = to_platform_device(component->dev);

	rt5514->mclk = devm_clk_get_optional(component->dev, "mclk");
	if (IS_ERR(rt5514->mclk))
+1 −2
Original line number Diff line number Diff line
@@ -175,8 +175,7 @@ static int imx8_run(struct snd_sof_dev *sdev)

static int imx8_probe(struct snd_sof_dev *sdev)
{
	struct platform_device *pdev =
		container_of(sdev->dev, struct platform_device, dev);
	struct platform_device *pdev = to_platform_device(sdev->dev);
	struct device_node *np = pdev->dev.of_node;
	struct device_node *res_node;
	struct resource *mmio;
+1 −2
Original line number Diff line number Diff line
@@ -144,8 +144,7 @@ static int imx8m_reset(struct snd_sof_dev *sdev)

static int imx8m_probe(struct snd_sof_dev *sdev)
{
	struct platform_device *pdev =
		container_of(sdev->dev, struct platform_device, dev);
	struct platform_device *pdev = to_platform_device(sdev->dev);
	struct device_node *np = pdev->dev.of_node;
	struct device_node *res_node;
	struct resource *mmio;
+1 −2
Original line number Diff line number Diff line
@@ -155,8 +155,7 @@ static int imx8ulp_reset(struct snd_sof_dev *sdev)

static int imx8ulp_probe(struct snd_sof_dev *sdev)
{
	struct platform_device *pdev =
		container_of(sdev->dev, struct platform_device, dev);
	struct platform_device *pdev = to_platform_device(sdev->dev);
	struct device_node *np = pdev->dev.of_node;
	struct device_node *res_node;
	struct resource *mmio;
+1 −2
Original line number Diff line number Diff line
@@ -410,8 +410,7 @@ static int bdw_probe(struct snd_sof_dev *sdev)
{
	struct snd_sof_pdata *pdata = sdev->pdata;
	const struct sof_dev_desc *desc = pdata->desc;
	struct platform_device *pdev =
		container_of(sdev->dev, struct platform_device, dev);
	struct platform_device *pdev = to_platform_device(sdev->dev);
	const struct sof_intel_dsp_desc *chip;
	struct resource *mmio;
	u32 base, size;
Loading