Commit 99311b8a authored by Mark Brown's avatar Mark Brown

spi: atmel-quadspi: Fix uninitialized res

Merge series from Jinjie Ruan <ruanjinjie@huawei.com>:

Fix uninitialized res in probe function.
parents 11543f53 2d3e6351
...@@ -602,17 +602,16 @@ static int atmel_qspi_probe(struct platform_device *pdev) ...@@ -602,17 +602,16 @@ static int atmel_qspi_probe(struct platform_device *pdev)
/* Map the registers */ /* Map the registers */
aq->regs = devm_platform_ioremap_resource_byname(pdev, "qspi_base"); aq->regs = devm_platform_ioremap_resource_byname(pdev, "qspi_base");
if (IS_ERR(aq->regs)) { if (IS_ERR(aq->regs))
dev_err(&pdev->dev, "missing registers\n"); return dev_err_probe(&pdev->dev, PTR_ERR(aq->regs),
return PTR_ERR(aq->regs); "missing registers\n");
}
/* Map the AHB memory */ /* Map the AHB memory */
aq->mem = devm_platform_ioremap_resource_byname(pdev, "qspi_mmap"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_mmap");
if (IS_ERR(aq->mem)) { aq->mem = devm_ioremap_resource(&pdev->dev, res);
dev_err(&pdev->dev, "missing AHB memory\n"); if (IS_ERR(aq->mem))
return PTR_ERR(aq->mem); return dev_err_probe(&pdev->dev, PTR_ERR(aq->mem),
} "missing AHB memory\n");
aq->mmap_size = resource_size(res); aq->mmap_size = resource_size(res);
...@@ -621,17 +620,15 @@ static int atmel_qspi_probe(struct platform_device *pdev) ...@@ -621,17 +620,15 @@ static int atmel_qspi_probe(struct platform_device *pdev)
if (IS_ERR(aq->pclk)) if (IS_ERR(aq->pclk))
aq->pclk = devm_clk_get(&pdev->dev, NULL); aq->pclk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(aq->pclk)) { if (IS_ERR(aq->pclk))
dev_err(&pdev->dev, "missing peripheral clock\n"); return dev_err_probe(&pdev->dev, PTR_ERR(aq->pclk),
return PTR_ERR(aq->pclk); "missing peripheral clock\n");
}
/* Enable the peripheral clock */ /* Enable the peripheral clock */
err = clk_prepare_enable(aq->pclk); err = clk_prepare_enable(aq->pclk);
if (err) { if (err)
dev_err(&pdev->dev, "failed to enable the peripheral clock\n"); return dev_err_probe(&pdev->dev, err,
return err; "failed to enable the peripheral clock\n");
}
aq->caps = of_device_get_match_data(&pdev->dev); aq->caps = of_device_get_match_data(&pdev->dev);
if (!aq->caps) { if (!aq->caps) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment