Commit 83b12c2e authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

ASoC: amd: Fix a NULL vs IS_ERR() check in probe

The platform_device_register_full() function doesn't return NULL, it
returns error pointers.

Fixes: 7894a7e7 ("ASoC: amd: create ACP3x PCM platform device")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 64ef0817
...@@ -97,10 +97,10 @@ static int snd_acp3x_probe(struct pci_dev *pci, ...@@ -97,10 +97,10 @@ static int snd_acp3x_probe(struct pci_dev *pci,
pdevinfo.size_data = sizeof(irqflags); pdevinfo.size_data = sizeof(irqflags);
adata->pdev = platform_device_register_full(&pdevinfo); adata->pdev = platform_device_register_full(&pdevinfo);
if (!adata->pdev) { if (IS_ERR(adata->pdev)) {
dev_err(&pci->dev, "cannot register %s device\n", dev_err(&pci->dev, "cannot register %s device\n",
pdevinfo.name); pdevinfo.name);
ret = -ENODEV; ret = PTR_ERR(adata->pdev);
goto unmap_mmio; goto unmap_mmio;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment