mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
spi: sg2044-nor: fix uninitialized variable in probe
The "base" pointer is uninitialized. It should be "spifmc->io_base"
instead.
Fixes: de16c322ee ("spi: sophgo: add SG2044 SPI NOR controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Link: https://patch.msgid.link/d343921b-16b8-429b-888a-f51bb6f2edc8@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
16c6cac246
commit
a1d8f70954
|
|
@ -427,7 +427,6 @@ static int sg2044_spifmc_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct spi_controller *ctrl;
|
||||
struct sg2044_spifmc *spifmc;
|
||||
void __iomem *base;
|
||||
int ret;
|
||||
|
||||
ctrl = devm_spi_alloc_host(&pdev->dev, sizeof(*spifmc));
|
||||
|
|
@ -447,8 +446,8 @@ static int sg2044_spifmc_probe(struct platform_device *pdev)
|
|||
spifmc->ctrl = ctrl;
|
||||
|
||||
spifmc->io_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(base))
|
||||
return PTR_ERR(base);
|
||||
if (IS_ERR(spifmc->io_base))
|
||||
return PTR_ERR(spifmc->io_base);
|
||||
|
||||
ctrl->num_chipselect = 1;
|
||||
ctrl->dev.of_node = pdev->dev.of_node;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user