summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-08-29 19:38:53 +0200
committerMark Brown <broonie@kernel.org>2024-08-29 19:38:53 +0200
commit1db86650b978bf4bf70267556f6bf7bc8b2253da (patch)
treed40553a8485a2ffdbf33c8f95305c9a39f2a8861 /drivers/spi
parentspi: nxp-fspi: Use max macro (diff)
parentspi: wpcm-fiu: Simplify with dev_err_probe() (diff)
downloadlinux-1db86650b978bf4bf70267556f6bf7bc8b2253da.tar.xz
linux-1db86650b978bf4bf70267556f6bf7bc8b2253da.zip
spi: wpcm-fiu: Fix uninitialized res
Merge series from Jinjie Ruan <ruanjinjie@huawei.com>: Fix uninitialized res in probe function.
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-wpcm-fiu.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c
index 47e485fd8f84..a9aee2a6c7dc 100644
--- a/drivers/spi/spi-wpcm-fiu.c
+++ b/drivers/spi/spi-wpcm-fiu.c
@@ -449,21 +449,20 @@ static int wpcm_fiu_probe(struct platform_device *pdev)
fiu->dev = dev;
fiu->regs = devm_platform_ioremap_resource_byname(pdev, "control");
- if (IS_ERR(fiu->regs)) {
- dev_err(dev, "Failed to map registers\n");
- return PTR_ERR(fiu->regs);
- }
+ if (IS_ERR(fiu->regs))
+ return dev_err_probe(dev, PTR_ERR(fiu->regs),
+ "Failed to map registers\n");
fiu->clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(fiu->clk))
return PTR_ERR(fiu->clk);
- fiu->memory = devm_platform_ioremap_resource_byname(pdev, "memory");
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory");
+ fiu->memory = devm_ioremap_resource(dev, res);
fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL);
- if (IS_ERR(fiu->memory)) {
- dev_err(dev, "Failed to map flash memory window\n");
- return PTR_ERR(fiu->memory);
- }
+ if (IS_ERR(fiu->memory))
+ return dev_err_probe(dev, PTR_ERR(fiu->memory),
+ "Failed to map flash memory window\n");
fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm");