[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d343921b-16b8-429b-888a-f51bb6f2edc8@stanley.mountain>
Date: Fri, 14 Mar 2025 13:10:26 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Longbin Li <looong.bin@...il.com>
Cc: Mark Brown <broonie@...nel.org>, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] spi: sg2044-nor: fix uninitialized variable in probe
The "base" pointer is uninitialized. It should be "spifmc->io_base"
instead.
Fixes: de16c322eefb ("spi: sophgo: add SG2044 SPI NOR controller driver")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
drivers/spi/spi-sg2044-nor.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-sg2044-nor.c b/drivers/spi/spi-sg2044-nor.c
index baa4cf677663..97d6b3a21d54 100644
--- a/drivers/spi/spi-sg2044-nor.c
+++ b/drivers/spi/spi-sg2044-nor.c
@@ -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;
--
2.47.2
Powered by blists - more mailing lists