diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-02-21 21:52:35 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-12 14:23:17 -0400 |
commit | d77b5382e67d1e1394e40c5c95fb5947efe0ff9e (patch) | |
tree | 924abeb94a522466207130270924e95c97d4220a /drivers/spi/spi-pxa2xx-pci.c | |
parent | f6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff) |
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.c | 4 |
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, | |||
47 | pi.size_data = sizeof(spi_pdata); | 47 | pi.size_data = sizeof(spi_pdata); |
48 | 48 | ||
49 | pdev = platform_device_register_full(&pi); | 49 | pdev = platform_device_register_full(&pi); |
50 | if (!pdev) | 50 | if (IS_ERR(pdev)) |
51 | return -ENOMEM; | 51 | return PTR_ERR(pdev); |
52 | 52 | ||
53 | pci_set_drvdata(dev, pdev); | 53 | pci_set_drvdata(dev, pdev); |
54 | 54 | ||