Skip to content

Commit b9b3a8b

Browse files
rajanv-xilinxgregkh
authored andcommitted
firmware: xilinx: Remove eemi ops for get_api_version
Use direct function calls instead of using eemi ops. So remove eemi ops for get_api_version and use direct function call. 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-2-git-send-email-jolly.shah@xilinx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7536ad8 commit b9b3a8b

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

‎drivers/firmware/xilinx/zynqmp-debug.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret)
9292

9393
switch (pm_id) {
9494
case PM_GET_API_VERSION:
95-
ret = eemi_ops->get_api_version(&pm_api_version);
95+
ret = zynqmp_pm_get_api_version(&pm_api_version);
9696
sprintf(debugfs_buf, "PM-API Version = %d.%d\n",
9797
pm_api_version >> 16, pm_api_version & 0xffff);
9898
break;

‎drivers/firmware/xilinx/zynqmp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static u32 pm_tz_version;
219219
*
220220
* Return: Returns status, either success or error+reason
221221
*/
222-
static int zynqmp_pm_get_api_version(u32 *version)
222+
int zynqmp_pm_get_api_version(u32 *version)
223223
{
224224
u32 ret_payload[PAYLOAD_ARG_CNT];
225225
int ret;
@@ -237,6 +237,7 @@ static int zynqmp_pm_get_api_version(u32 *version)
237237

238238
return ret;
239239
}
240+
EXPORT_SYMBOL_GPL(zynqmp_pm_get_api_version);
240241

241242
/**
242243
* zynqmp_pm_get_chipid - Get silicon ID registers
@@ -734,7 +735,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out)
734735
}
735736

736737
static const struct zynqmp_eemi_ops eemi_ops = {
737-
.get_api_version = zynqmp_pm_get_api_version,
738738
.get_chipid = zynqmp_pm_get_chipid,
739739
.query_data = zynqmp_pm_query_data,
740740
.clock_enable = zynqmp_pm_clock_enable,

‎drivers/soc/xilinx/zynqmp_power.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
186186
if (IS_ERR(eemi_ops))
187187
return PTR_ERR(eemi_ops);
188188

189-
if (!eemi_ops->get_api_version || !eemi_ops->init_finalize)
189+
if (!eemi_ops->init_finalize)
190190
return -ENXIO;
191191

192192
eemi_ops->init_finalize();
193-
eemi_ops->get_api_version(&pm_api_version);
193+
zynqmp_pm_get_api_version(&pm_api_version);
194194

195195
/* Check PM API version number */
196196
if (pm_api_version < ZYNQMP_PM_VERSION)

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ struct zynqmp_pm_query_data {
294294
};
295295

296296
struct zynqmp_eemi_ops {
297-
int (*get_api_version)(u32 *version);
298297
int (*get_chipid)(u32 *idcode, u32 *version);
299298
int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
300299
int (*fpga_get_status)(u32 *value);
@@ -331,11 +330,16 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
331330

332331
#if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE)
333332
const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void);
333+
int zynqmp_pm_get_api_version(u32 *version);
334334
#else
335335
static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
336336
{
337337
return ERR_PTR(-ENODEV);
338338
}
339+
static inline int zynqmp_pm_get_api_version(u32 *version)
340+
{
341+
return -ENODEV;
342+
}
339343
#endif
340344

341345
#endif /* __FIRMWARE_ZYNQMP_H__ */

0 commit comments

Comments
 (0)