summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-pxa2xx-pci.c
diff options
context:
space:
mode:
authorWei Yongjun2013-02-22 03:52:35 +0100
committerMark Brown2013-03-12 19:23:17 +0100
commitd77b5382e67d1e1394e40c5c95fb5947efe0ff9e (patch)
tree924abeb94a522466207130270924e95c97d4220a /drivers/spi/spi-pxa2xx-pci.c
parentLinux 3.9-rc2 (diff)
downloadkernel-qcow2-linux-d77b5382e67d1e1394e40c5c95fb5947efe0ff9e.tar.gz
kernel-qcow2-linux-d77b5382e67d1e1394e40c5c95fb5947efe0ff9e.tar.xz
kernel-qcow2-linux-d77b5382e67d1e1394e40c5c95fb5947efe0ff9e.zip
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 <yongjun_wei@trendmicro.com.cn> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi/spi-pxa2xx-pci.c')
-rw-r--r--drivers/spi/spi-pxa2xx-pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 364964d2ed04..0a11dcfc631b 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -47,8 +47,8 @@ static int ce4100_spi_probe(struct pci_dev *dev,
pi.size_data = sizeof(spi_pdata);
pdev = platform_device_register_full(&pi);
- if (!pdev)
- return -ENOMEM;
+ if (IS_ERR(pdev))
+ return PTR_ERR(pdev);
pci_set_drvdata(dev, pdev);