Skip to content

Commit

Permalink
pcmcia: soc_common: Handle return value of clk_prepare_enable
Browse files Browse the repository at this point in the history
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
CC: Russell King <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
  • Loading branch information
ArvindYadavCs authored and Dominik Brodowski committed Jan 24, 2018
1 parent 3490a69 commit d3fdd70
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/pcmcia/soc_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,16 @@ static int soc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
{
int ret = 0, i;

clk_prepare_enable(skt->clk);
ret = clk_prepare_enable(skt->clk);
if (ret)
return ret;

if (skt->ops->hw_init) {
ret = skt->ops->hw_init(skt);
if (ret)
if (ret) {
clk_disable_unprepare(skt->clk);
return ret;
}
}

for (i = 0; i < ARRAY_SIZE(skt->stat); i++) {
Expand Down

0 comments on commit d3fdd70

Please sign in to comment.