MLK-17787 clk: imx: gate-scu: fix return code
authorPeng Fan <peng.fan@nxp.com>
Tue, 13 Mar 2018 07:43:53 +0000 (15:43 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:56:58 +0000 (14:56 -0500)
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 <peng.fan@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
drivers/clk/imx/clk-gate-scu.c

index 04e198c..abcda5f 100644 (file)
@@ -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)