diff mbox series

[-next] ALSA: hda/tegra: Use devm_platform_get_and_ioremap_resource()

Message ID 20210610131922.134788-1-yangyingliang@huawei.com
State Accepted
Commit 01893553e67c768985dc1531fa89fb04aa5134ce
Headers show
Series [-next] ALSA: hda/tegra: Use devm_platform_get_and_ioremap_resource() | expand

Commit Message

Yang Yingliang June 10, 2021, 1:19 p.m. UTC
Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 sound/pci/hda/hda_tegra.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Takashi Iwai June 12, 2021, 7:30 a.m. UTC | #1
On Thu, 10 Jun 2021 15:19:22 +0200,
Yang Yingliang wrote:
> 
> Use devm_platform_get_and_ioremap_resource() to simplify
> code.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Thanks, applied.


Takashi
diff mbox series

Patch

diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index 6f2b743b9d75..5aeef6123781 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -235,11 +235,9 @@  static int hda_tegra_init_chip(struct azx *chip, struct platform_device *pdev)
 {
 	struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip);
 	struct hdac_bus *bus = azx_bus(chip);
-	struct device *dev = hda->dev;
 	struct resource *res;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	hda->regs = devm_ioremap_resource(dev, res);
+	hda->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(hda->regs))
 		return PTR_ERR(hda->regs);