firmware: xilinx: Remove eemi ops for clock_getstate
authorRajan Vaja <rajan.vaja@xilinx.com>
Fri, 24 Apr 2020 20:57:48 +0000 (13:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Apr 2020 13:45:07 +0000 (15:45 +0200)
Use direct function call instead of eemi ops for clock_getstate.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
Signed-off-by: Jolly Shah <jolly.shah@xilinx.com>
Link: https://lore.kernel.org/r/1587761887-4279-7-git-send-email-jolly.shah@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/zynqmp/clk-gate-zynqmp.c
drivers/clk/zynqmp/pll.c
drivers/firmware/xilinx/zynqmp.c
include/linux/firmware/xlnx-zynqmp.h

index 11f1b9718c3d0f48001a992dede39d0c4fc01701..10c9b889324f26b53034eed54e716d937c638f6f 100644 (file)
@@ -77,9 +77,8 @@ static int zynqmp_clk_gate_is_enabled(struct clk_hw *hw)
        const char *clk_name = clk_hw_get_name(hw);
        u32 clk_id = gate->clk_id;
        int state, ret;
-       const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
 
-       ret = eemi_ops->clock_getstate(clk_id, &state);
+       ret = zynqmp_pm_clock_getstate(clk_id, &state);
        if (ret) {
                pr_warn_once("%s() clock get state failed for %s, ret = %d\n",
                             __func__, clk_name, ret);
index 38b8dbc693f48dd817f1c227c288da52d33f6eae..41f376aad801cb858fc0a05327e944e295df4af6 100644 (file)
@@ -222,9 +222,8 @@ static int zynqmp_pll_is_enabled(struct clk_hw *hw)
        u32 clk_id = clk->clk_id;
        unsigned int state;
        int ret;
-       const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
 
-       ret = eemi_ops->clock_getstate(clk_id, &state);
+       ret = zynqmp_pm_clock_getstate(clk_id, &state);
        if (ret) {
                pr_warn_once("%s() clock get state failed for %s, ret = %d\n",
                             __func__, clk_name, ret);
index d884805b7d6b5d654b5b3ed3d6f792a4b7fa180b..c11b528f4a371ded6d20eeda8c6738c3ebcf7d86 100644 (file)
@@ -382,7 +382,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_disable);
  *
  * Return: Returns status, either success or error+reason
  */
-static int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
+int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
 {
        u32 ret_payload[PAYLOAD_ARG_CNT];
        int ret;
@@ -393,6 +393,7 @@ static int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
 
        return ret;
 }
+EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getstate);
 
 /**
  * zynqmp_pm_clock_setdivider() - Set the clock divider for given id
@@ -739,7 +740,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out)
 }
 
 static const struct zynqmp_eemi_ops eemi_ops = {
-       .clock_getstate = zynqmp_pm_clock_getstate,
        .clock_setdivider = zynqmp_pm_clock_setdivider,
        .clock_getdivider = zynqmp_pm_clock_getdivider,
        .clock_setrate = zynqmp_pm_clock_setrate,
index f9a84d974b5c4e98d66b9573582c6c44cea99a48..e874f0c5e7ab9cc19cc2d7620ca670b4419d5b6b 100644 (file)
@@ -296,7 +296,6 @@ struct zynqmp_pm_query_data {
 struct zynqmp_eemi_ops {
        int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
        int (*fpga_get_status)(u32 *value);
-       int (*clock_getstate)(u32 clock_id, u32 *state);
        int (*clock_setdivider)(u32 clock_id, u32 divider);
        int (*clock_getdivider)(u32 clock_id, u32 *divider);
        int (*clock_setrate)(u32 clock_id, u64 rate);
@@ -331,6 +330,7 @@ int zynqmp_pm_get_chipid(u32 *idcode, u32 *version);
 int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out);
 int zynqmp_pm_clock_enable(u32 clock_id);
 int zynqmp_pm_clock_disable(u32 clock_id);
+int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state);
 #else
 static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
 {
@@ -357,6 +357,10 @@ static inline int zynqmp_pm_clock_disable(u32 clock_id)
 {
        return -ENODEV;
 }
+static inline int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
+{
+       return -ENODEV;
+}
 #endif
 
 #endif /* __FIRMWARE_ZYNQMP_H__ */