Commit 6f0c3091 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Greg Kroah-Hartman

serial: of_serial: check the return value of clk_prepare_enable()

The function clk_prepare_enable() may fail, and in that case it
does not make sense to proceed.  Let's check its return code and
error out if it is a negative value.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3a63d224
......@@ -74,7 +74,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
return PTR_ERR(info->clk);
}
clk_prepare_enable(info->clk);
ret = clk_prepare_enable(info->clk);
if (ret < 0)
return ret;
clk = clk_get_rate(info->clk);
}
/* If current-speed was set, then try not to change it. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment