From 2255ad027e611e872a16948ab1d1b310a87f2350 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Tue, 13 Mar 2018 15:43:53 +0800 Subject: [PATCH] MLK-17787 clk: imx: gate-scu: fix return code The sc api error code is not compatible with Linux error code, directly returning the sc api error code to caller is wrong. Signed-off-by: Peng Fan Reviewed-by: Anson Huang --- drivers/clk/imx/clk-gate-scu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk-gate-scu.c b/drivers/clk/imx/clk-gate-scu.c index 04e198cecd02..abcda5f9a952 100644 --- a/drivers/clk/imx/clk-gate-scu.c +++ b/drivers/clk/imx/clk-gate-scu.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 Freescale Semiconductor, Inc. - * Copyright 2017 NXP + * Copyright 2017-2018 NXP * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -123,7 +123,10 @@ static int clk_gate_scu_prepare(struct clk_hw *hw) sci_err = sc_pm_clock_enable(ccm_ipc_handle, gate->rsrc_id, gate->clk_type, true, gate->hw_gate); - return sci_err; + if (sci_err != SC_ERR_NONE) + return -EINVAL; + + return 0; } static void clk_gate_scu_unprepare(struct clk_hw *hw) -- 2.17.1