Skip to content

Commit 5e76731

Browse files
rajanv-xilinxgregkh
authored andcommitted
firmware: xilinx: Remove eemi ops for clock_getstate
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>
1 parent f5ccd54 commit 5e76731

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎drivers/clk/zynqmp/clk-gate-zynqmp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ static int zynqmp_clk_gate_is_enabled(struct clk_hw *hw)
7777
const char *clk_name = clk_hw_get_name(hw);
7878
u32 clk_id = gate->clk_id;
7979
int state, ret;
80-
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
8180

82-
ret = eemi_ops->clock_getstate(clk_id, &state);
81+
ret = zynqmp_pm_clock_getstate(clk_id, &state);
8382
if (ret) {
8483
pr_warn_once("%s() clock get state failed for %s, ret = %d\n",
8584
__func__, clk_name, ret);

‎drivers/clk/zynqmp/pll.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ static int zynqmp_pll_is_enabled(struct clk_hw *hw)
222222
u32 clk_id = clk->clk_id;
223223
unsigned int state;
224224
int ret;
225-
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
226225

227-
ret = eemi_ops->clock_getstate(clk_id, &state);
226+
ret = zynqmp_pm_clock_getstate(clk_id, &state);
228227
if (ret) {
229228
pr_warn_once("%s() clock get state failed for %s, ret = %d\n",
230229
__func__, clk_name, ret);

‎drivers/firmware/xilinx/zynqmp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_disable);
382382
*
383383
* Return: Returns status, either success or error+reason
384384
*/
385-
static int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
385+
int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
386386
{
387387
u32 ret_payload[PAYLOAD_ARG_CNT];
388388
int ret;
@@ -393,6 +393,7 @@ static int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
393393

394394
return ret;
395395
}
396+
EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getstate);
396397

397398
/**
398399
* 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)
739740
}
740741

741742
static const struct zynqmp_eemi_ops eemi_ops = {
742-
.clock_getstate = zynqmp_pm_clock_getstate,
743743
.clock_setdivider = zynqmp_pm_clock_setdivider,
744744
.clock_getdivider = zynqmp_pm_clock_getdivider,
745745
.clock_setrate = zynqmp_pm_clock_setrate,

‎include/linux/firmware/xlnx-zynqmp.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ struct zynqmp_pm_query_data {
296296
struct zynqmp_eemi_ops {
297297
int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
298298
int (*fpga_get_status)(u32 *value);
299-
int (*clock_getstate)(u32 clock_id, u32 *state);
300299
int (*clock_setdivider)(u32 clock_id, u32 divider);
301300
int (*clock_getdivider)(u32 clock_id, u32 *divider);
302301
int (*clock_setrate)(u32 clock_id, u64 rate);
@@ -331,6 +330,7 @@ int zynqmp_pm_get_chipid(u32 *idcode, u32 *version);
331330
int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out);
332331
int zynqmp_pm_clock_enable(u32 clock_id);
333332
int zynqmp_pm_clock_disable(u32 clock_id);
333+
int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state);
334334
#else
335335
static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
336336
{
@@ -357,6 +357,10 @@ static inline int zynqmp_pm_clock_disable(u32 clock_id)
357357
{
358358
return -ENODEV;
359359
}
360+
static inline int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
361+
{
362+
return -ENODEV;
363+
}
360364
#endif
361365

362366
#endif /* __FIRMWARE_ZYNQMP_H__ */

0 commit comments

Comments
 (0)