clk: zynqmp: handle fixed factor param query error
authorRajan Vaja <rajan.vaja@xilinx.com>
Wed, 14 Nov 2018 07:46:49 +0000 (23:46 -0800)
committerStephen Boyd <sboyd@kernel.org>
Wed, 14 Nov 2018 22:29:36 +0000 (14:29 -0800)
Return proper error code in case query for fixed factor
parameter fails. This also fixes build warning for set
but not used variable 'ret'.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Fixes: 3fde0e16d016 ("drivers: clk: Add ZynqMP clock driver")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/zynqmp/clkc.c

index 9d7d297f0ea8d9b0fbc5c5e5a02c172b0ae14064..297f16a20bfc5d3bae8dd8806cc8585d851383c0 100644 (file)
@@ -279,6 +279,9 @@ struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name, u32 clk_id,
        qdata.arg1 = clk_id;
 
        ret = eemi_ops->query_data(qdata, ret_payload);
+       if (ret)
+               return ERR_PTR(ret);
+
        mult = ret_payload[1];
        div = ret_payload[2];