Skip to content

Commit d77b538

Browse files
Wei Yongjunbroonie
authored andcommitted
spi: fix return value check in ce4100_spi_probe()
In case of error, the function platform_device_register_full() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent f6161aa commit d77b538

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/spi/spi-pxa2xx-pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ static int ce4100_spi_probe(struct pci_dev *dev,
4747
pi.size_data = sizeof(spi_pdata);
4848

4949
pdev = platform_device_register_full(&pi);
50-
if (!pdev)
51-
return -ENOMEM;
50+
if (IS_ERR(pdev))
51+
return PTR_ERR(pdev);
5252

5353
pci_set_drvdata(dev, pdev);
5454

0 commit comments

Comments
 (0)