Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 64d87ccfae33 ("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>

authored by

Dan Carpenter and committed by
Mark Brown
0cc08c81 d77daa49

+2 -2
+2 -2
drivers/spi/spi-aspeed-smc.c
··· 865 865 return PTR_ERR(aspi->regs); 866 866 867 867 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 868 - if (IS_ERR(res)) { 868 + if (!res) { 869 869 dev_err(dev, "missing AHB memory\n"); 870 - return PTR_ERR(res); 870 + return -EINVAL; 871 871 } 872 872 873 873 aspi->ahb_window_size = resource_size(res);