summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Ni <nichen@iscas.ac.cn>2024-04-03 07:33:49 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-17 12:43:51 +0300
commit63f6a1a4d5461038d1477e38b2a379a1e96a82af (patch)
tree1290413e619feafa7c0ea4ecc99dfd7beb22a6a0
parentc0edb6797bdfbeb975ab8367a368ccf4068802bd (diff)
downloadlinux-63f6a1a4d5461038d1477e38b2a379a1e96a82af.tar.xz
ata: sata_gemini: Check clk_enable() result
[ 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@iscas.ac.cn> Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/ata/sata_gemini.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ata/sata_gemini.c b/drivers/ata/sata_gemini.c
index 6fd54e968d10..1564472fd5d5 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 */