2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-28 23:23:55 +08:00

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: 7894a7e7ea ("ASoC: amd: create ACP3x PCM platform device")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Dan Carpenter 2018-11-26 11:13:07 +03:00 committed by Mark Brown
parent 64ef0817b9
commit 83b12c2e1d
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -97,10 +97,10 @@ static int snd_acp3x_probe(struct pci_dev *pci,
pdevinfo.size_data = sizeof(irqflags);
adata->pdev = platform_device_register_full(&pdevinfo);
if (!adata->pdev) {
if (IS_ERR(adata->pdev)) {
dev_err(&pci->dev, "cannot register %s device\n",
pdevinfo.name);
ret = -ENODEV;
ret = PTR_ERR(adata->pdev);
goto unmap_mmio;
}
break;