mirror of https://github.com/torvalds/linux.git
spi: aspeed: Fix an IS_ERR() vs NULL bug in probe()
The platform_get_resource() function doesn't return error pointers, it
returns NULL on error. Update the error checking to match.
Fixes: 64d87ccfae ("spi: aspeed: Only map necessary address window region")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aPJpEnfK31pHz8_w@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
d77daa4908
commit
0cc08c8130
|
|
@ -865,9 +865,9 @@ static int aspeed_spi_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(aspi->regs);
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
||||
if (IS_ERR(res)) {
|
||||
if (!res) {
|
||||
dev_err(dev, "missing AHB memory\n");
|
||||
return PTR_ERR(res);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
aspi->ahb_window_size = resource_size(res);
|
||||
|
|
|
|||
Loading…
Reference in New Issue