Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47325095 authored by Chen Ni's avatar Chen Ni Committed by Greg Kroah-Hartman
Browse files

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: default avatarChen Ni <nichen@iscas.ac.cn>
Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 510e7b18
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -200,7 +200,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 */