ASoC: amd: Fix a NULL vs IS_ERR() check in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 26 Nov 2018 08:13:07 +0000 (11:13 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 26 Nov 2018 12:22:56 +0000 (12:22 +0000)
The platform_device_register_full() function doesn't return NULL, it
returns error pointers.

Fixes: 7894a7e7ea3d ("ASoC: amd: create ACP3x PCM platform device")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/amd/raven/pci-acp3x.c

index c28457fd9b81d4efa21b315b6de0c9c7edb6bd67..facec2472b34ce20da2b67c660aaed58a667ea49 100644 (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;