From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Date: Fri, 22 Feb 2013 02:52:35 +0000 (+0800)
Subject: spi: fix return value check in ce4100_spi_probe()
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d77b5382e67d1e1394e40c5c95fb5947efe0ff9e;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

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>
---

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);