[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201228125037.167602366@linuxfoundation.org>
Date: Mon, 28 Dec 2020 13:45:35 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Hulk Robot <hulkci@...wei.com>,
Zhang Changzhong <zhangchangzhong@...wei.com>,
Serge Semin <fancer.lancer@...il.com>,
Mark Brown <broonie@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.10 337/717] spi: dw: Fix error return code in dw_spi_bt1_probe()
From: Zhang Changzhong <zhangchangzhong@...wei.com>
[ Upstream commit e748edd9841306908b4e02dddd0afd1aa1f8b973 ]
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.
Fixes: abf00907538e ("spi: dw: Add Baikal-T1 SPI Controller glue driver")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@...wei.com>
Acked-by: Serge Semin <fancer.lancer@...il.com>
Link: https://lore.kernel.org/r/1607071357-33378-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Mark Brown <broonie@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/spi/spi-dw-bt1.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-dw-bt1.c b/drivers/spi/spi-dw-bt1.c
index f382dfad78421..c279b7891e3ac 100644
--- a/drivers/spi/spi-dw-bt1.c
+++ b/drivers/spi/spi-dw-bt1.c
@@ -280,8 +280,10 @@ static int dw_spi_bt1_probe(struct platform_device *pdev)
dws->bus_num = pdev->id;
dws->reg_io_width = 4;
dws->max_freq = clk_get_rate(dwsbt1->clk);
- if (!dws->max_freq)
+ if (!dws->max_freq) {
+ ret = -EINVAL;
goto err_disable_clk;
+ }
init_func = device_get_match_data(&pdev->dev);
ret = init_func(pdev, dwsbt1);
--
2.27.0
Powered by blists - more mailing lists