mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
ASoC: mediatek: mt8192-afe-pcm: Simplify probe() with local dev variable
[ Upstream commit01981565c7] Simplify the function mt8192_afe_pcm_dev_probe() by using local 'dev' instead of '&pdev->dev'. Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Link: https://patch.msgid.link/20241025080026.2393-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown <broonie@kernel.org> Stable-dep-of:e24d5dde56("ASoC: mediatek: mt8192: Check runtime resume during probe") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
074371b2d5
commit
5f2ae0405f
@@ -2164,27 +2164,26 @@ static int mt8192_afe_pcm_dev_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct mtk_base_afe *afe;
|
||||
struct mt8192_afe_private *afe_priv;
|
||||
struct device *dev;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct reset_control *rstc;
|
||||
int i, ret, irq_id;
|
||||
|
||||
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34));
|
||||
ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(34));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
afe = devm_kzalloc(&pdev->dev, sizeof(*afe), GFP_KERNEL);
|
||||
afe = devm_kzalloc(dev, sizeof(*afe), GFP_KERNEL);
|
||||
if (!afe)
|
||||
return -ENOMEM;
|
||||
platform_set_drvdata(pdev, afe);
|
||||
|
||||
afe->platform_priv = devm_kzalloc(&pdev->dev, sizeof(*afe_priv),
|
||||
afe->platform_priv = devm_kzalloc(dev, sizeof(*afe_priv),
|
||||
GFP_KERNEL);
|
||||
if (!afe->platform_priv)
|
||||
return -ENOMEM;
|
||||
afe_priv = afe->platform_priv;
|
||||
|
||||
afe->dev = &pdev->dev;
|
||||
dev = afe->dev;
|
||||
afe->dev = dev;
|
||||
|
||||
ret = of_reserved_mem_device_init(dev);
|
||||
if (ret) {
|
||||
@@ -2212,7 +2211,7 @@ static int mt8192_afe_pcm_dev_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "failed to trigger audio reset\n");
|
||||
|
||||
ret = devm_pm_runtime_enable(&pdev->dev);
|
||||
ret = devm_pm_runtime_enable(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -2228,13 +2227,13 @@ static int mt8192_afe_pcm_dev_probe(struct platform_device *pdev)
|
||||
|
||||
/* enable clock for regcache get default value from hw */
|
||||
afe_priv->pm_runtime_bypass_reg_ctl = true;
|
||||
pm_runtime_get_sync(&pdev->dev);
|
||||
pm_runtime_get_sync(dev);
|
||||
|
||||
ret = regmap_reinit_cache(afe->regmap, &mt8192_afe_regmap_config);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "regmap_reinit_cache fail\n");
|
||||
|
||||
pm_runtime_put_sync(&pdev->dev);
|
||||
pm_runtime_put_sync(dev);
|
||||
afe_priv->pm_runtime_bypass_reg_ctl = false;
|
||||
|
||||
regcache_cache_only(afe->regmap, true);
|
||||
@@ -2301,7 +2300,7 @@ static int mt8192_afe_pcm_dev_probe(struct platform_device *pdev)
|
||||
afe->runtime_suspend = mt8192_afe_runtime_suspend;
|
||||
|
||||
/* register platform */
|
||||
ret = devm_snd_soc_register_component(&pdev->dev,
|
||||
ret = devm_snd_soc_register_component(dev,
|
||||
&mtk_afe_pcm_platform,
|
||||
afe->dai_drivers,
|
||||
afe->num_dai_drivers);
|
||||
|
||||
Reference in New Issue
Block a user