Skip to content

Commit

Permalink
spi: fix return value check in ce4100_spi_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Mark Brown committed Mar 12, 2013
1 parent f6161aa commit d77b538
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-pxa2xx-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d77b538

Please sign in to comment.