In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
spi->direct_access[cs].vaddr = devm_ioremap(&pdev->dev,
r->start,
PAGE_SIZE);
- if (IS_ERR(spi->direct_access[cs].vaddr)) {
- status = PTR_ERR(spi->direct_access[cs].vaddr);
+ if (!spi->direct_access[cs].vaddr) {
+ status = -ENOMEM;
goto out_rel_clk;
}
spi->direct_access[cs].size = PAGE_SIZE;