[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240415100433.3127434-5-sashal@kernel.org>
Date: Mon, 15 Apr 2024 06:04:26 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Chen Ni <nichen@...as.ac.cn>,
Damien Le Moal <dlemoal@...nel.org>,
Sasha Levin <sashal@...nel.org>,
linus.walleij@...aro.org,
cassel@...nel.org,
linux-ide@...r.kernel.org
Subject: [PATCH AUTOSEL 6.1 5/6] ata: sata_gemini: Check clk_enable() result
From: Chen Ni <nichen@...as.ac.cn>
[ Upstream commit e85006ae7430aef780cc4f0849692e266a102ec0 ]
The call to clk_enable() in gemini_sata_start_bridge() can fail.
Add a check to detect such failure.
Signed-off-by: Chen Ni <nichen@...as.ac.cn>
Signed-off-by: Damien Le Moal <dlemoal@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/ata/sata_gemini.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/sata_gemini.c b/drivers/ata/sata_gemini.c
index c96fcf9ee3c07..01f050b1bc93b 100644
--- a/drivers/ata/sata_gemini.c
+++ b/drivers/ata/sata_gemini.c
@@ -201,7 +201,10 @@ int gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge)
pclk = sg->sata0_pclk;
else
pclk = sg->sata1_pclk;
- clk_enable(pclk);
+ ret = clk_enable(pclk);
+ if (ret)
+ return ret;
+
msleep(10);
/* Do not keep clocking a bridge that is not online */
--
2.43.0
Powered by blists - more mailing lists