mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
can: mscan-mpc5xxx: fix return value check in mpc512x_can_get_clock()
commit f61bd0585d
upstream.
In case of error, the function clk_get() returns ERR_PTR()
and never returns NULL pointer. The NULL test in the error
handling should be replaced with IS_ERR().
dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7b5c87e016
commit
0f0c5909d4
1 changed files with 2 additions and 2 deletions
|
@ -181,7 +181,7 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
|
|||
|
||||
if (!clock_name || !strcmp(clock_name, "sys")) {
|
||||
sys_clk = clk_get(&ofdev->dev, "sys_clk");
|
||||
if (!sys_clk) {
|
||||
if (IS_ERR(sys_clk)) {
|
||||
dev_err(&ofdev->dev, "couldn't get sys_clk\n");
|
||||
goto exit_unmap;
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
|
|||
|
||||
if (clocksrc < 0) {
|
||||
ref_clk = clk_get(&ofdev->dev, "ref_clk");
|
||||
if (!ref_clk) {
|
||||
if (IS_ERR(ref_clk)) {
|
||||
dev_err(&ofdev->dev, "couldn't get ref_clk\n");
|
||||
goto exit_unmap;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue