summaryrefslogtreecommitdiff
path: root/drivers/ata
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:56:05 +0300
commit337f84a0efe21dccef8b11a73cd19fb332af0ea2 (patch)
treec9a680d1227988bbfdadcddf25ca3b589149e773 /drivers/ata
parent9c08b9a943393ed095005e83b4ca753b097b2407 (diff)
downloadlinux-337f84a0efe21dccef8b11a73cd19fb332af0ea2.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>
Diffstat (limited to 'drivers/ata')
-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 c96fcf9ee3c0..01f050b1bc93 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 */