summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorJinjie Ruan <ruanjinjie@huawei.com>2024-08-26 15:14:21 +0300
committerMark Brown <broonie@kernel.org>2024-08-30 17:14:18 +0300
commitd814fd0f046c2a6b1a919e1a529550bdfe9f9f9b (patch)
tree5418c638bab7c228a661a9d6fefd18d328f79aaa /drivers/spi
parent64640f6c972e80f52196416a8d4dc3c0ffcbc82d (diff)
downloadlinux-d814fd0f046c2a6b1a919e1a529550bdfe9f9f9b.tar.xz
spi: zynqmp-gqspi: Simplify with dev_err_probe()
Use the dev_err_probe() helper to simplify error handling during probe. This also handle scenario, when EDEFER is returned and useless error is printed. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Acked-by: Michal Simek <michal.simek@amd.com> Link: https://patch.msgid.link/20240826121421.3384792-3-ruanjinjie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-zynqmp-gqspi.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
index 0448bcb2b45c..e8963e0a6d9a 100644
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -1242,22 +1242,18 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
return PTR_ERR(xqspi->regs);
xqspi->pclk = devm_clk_get(&pdev->dev, "pclk");
- if (IS_ERR(xqspi->pclk)) {
- dev_err(dev, "pclk clock not found.\n");
- return PTR_ERR(xqspi->pclk);
- }
+ if (IS_ERR(xqspi->pclk))
+ return dev_err_probe(dev, PTR_ERR(xqspi->pclk),
+ "pclk clock not found.\n");
xqspi->refclk = devm_clk_get(&pdev->dev, "ref_clk");
- if (IS_ERR(xqspi->refclk)) {
- dev_err(dev, "ref_clk clock not found.\n");
- return PTR_ERR(xqspi->refclk);
- }
+ if (IS_ERR(xqspi->refclk))
+ return dev_err_probe(dev, PTR_ERR(xqspi->refclk),
+ "ref_clk clock not found.\n");
ret = clk_prepare_enable(xqspi->pclk);
- if (ret) {
- dev_err(dev, "Unable to enable APB clock.\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "Unable to enable APB clock.\n");
ret = clk_prepare_enable(xqspi->refclk);
if (ret) {