Commit 4b310108 authored by Rajan Vaja's avatar Rajan Vaja
Browse files

zynqmp: pm: Update return type in query functions



In pm_query_data() function return type is stored in response so
there is no use of return type. Update return type of function
pm_query_data() from enum pm_ret_status to void. Similarly
update return type of pm_api_clock_get_name() and
pm_api_pinctrl_get_function_name() functions.
Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Change-Id: Id811926f0b4ebcc472480bb94f3b88109eb036cd
parent de155790
...@@ -2446,7 +2446,7 @@ enum pm_ret_status pm_api_clock_get_num_clocks(unsigned int *nclocks) ...@@ -2446,7 +2446,7 @@ enum pm_ret_status pm_api_clock_get_num_clocks(unsigned int *nclocks)
* *
* @return Returns success. In case of error, name data is 0. * @return Returns success. In case of error, name data is 0.
*/ */
enum pm_ret_status pm_api_clock_get_name(unsigned int clock_id, char *name) void pm_api_clock_get_name(unsigned int clock_id, char *name)
{ {
if (clock_id == CLK_MAX) if (clock_id == CLK_MAX)
memcpy(name, END_OF_CLK, sizeof(END_OF_CLK) > CLK_NAME_LEN ? memcpy(name, END_OF_CLK, sizeof(END_OF_CLK) > CLK_NAME_LEN ?
...@@ -2458,8 +2458,6 @@ enum pm_ret_status pm_api_clock_get_name(unsigned int clock_id, char *name) ...@@ -2458,8 +2458,6 @@ enum pm_ret_status pm_api_clock_get_name(unsigned int clock_id, char *name)
else else
memcpy(name, ext_clocks[clock_id - CLK_MAX_OUTPUT_CLK].name, memcpy(name, ext_clocks[clock_id - CLK_MAX_OUTPUT_CLK].name,
CLK_NAME_LEN); CLK_NAME_LEN);
return PM_RET_SUCCESS;
} }
/** /**
......
/* /*
* Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -294,7 +294,7 @@ struct pm_pll *pm_clock_get_pll(enum clock_id clock_id); ...@@ -294,7 +294,7 @@ struct pm_pll *pm_clock_get_pll(enum clock_id clock_id);
struct pm_pll *pm_clock_get_pll_by_related_clk(enum clock_id clock_id); struct pm_pll *pm_clock_get_pll_by_related_clk(enum clock_id clock_id);
uint8_t pm_clock_has_div(unsigned int clock_id, enum pm_clock_div_id div_id); uint8_t pm_clock_has_div(unsigned int clock_id, enum pm_clock_div_id div_id);
enum pm_ret_status pm_api_clock_get_name(unsigned int clock_id, char *name); void pm_api_clock_get_name(unsigned int clock_id, char *name);
enum pm_ret_status pm_api_clock_get_num_clocks(unsigned int *nclocks); enum pm_ret_status pm_api_clock_get_num_clocks(unsigned int *nclocks);
enum pm_ret_status pm_api_clock_get_topology(unsigned int clock_id, enum pm_ret_status pm_api_clock_get_topology(unsigned int clock_id,
unsigned int index, unsigned int index,
......
...@@ -2604,18 +2604,13 @@ enum pm_ret_status pm_api_pinctrl_get_num_func_groups(unsigned int fid, ...@@ -2604,18 +2604,13 @@ enum pm_ret_status pm_api_pinctrl_get_num_func_groups(unsigned int fid,
* *
* This function is used by master to get name of function specified * This function is used by master to get name of function specified
* by given function ID. * by given function ID.
*
* @return Returns success. In case of error, name data is 0.
*/ */
enum pm_ret_status pm_api_pinctrl_get_function_name(unsigned int fid, void pm_api_pinctrl_get_function_name(unsigned int fid, char *name)
char *name)
{ {
if (fid >= MAX_FUNCTION) if (fid >= MAX_FUNCTION)
memcpy(name, END_OF_FUNCTION, FUNCTION_NAME_LEN); memcpy(name, END_OF_FUNCTION, FUNCTION_NAME_LEN);
else else
memcpy(name, pinctrl_functions[fid].name, FUNCTION_NAME_LEN); memcpy(name, pinctrl_functions[fid].name, FUNCTION_NAME_LEN);
return PM_RET_SUCCESS;
} }
/** /**
......
/* /*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -719,8 +719,7 @@ enum pm_ret_status pm_api_pinctrl_set_config(unsigned int pin, ...@@ -719,8 +719,7 @@ enum pm_ret_status pm_api_pinctrl_set_config(unsigned int pin,
enum pm_ret_status pm_api_pinctrl_get_config(unsigned int pin, enum pm_ret_status pm_api_pinctrl_get_config(unsigned int pin,
unsigned int param, unsigned int param,
unsigned int *value); unsigned int *value);
enum pm_ret_status pm_api_pinctrl_get_function_name(unsigned int fid, void pm_api_pinctrl_get_function_name(unsigned int fid, char *name);
char *name);
enum pm_ret_status pm_api_pinctrl_get_function_groups(unsigned int fid, enum pm_ret_status pm_api_pinctrl_get_function_groups(unsigned int fid,
unsigned int index, unsigned int index,
uint16_t *groups); uint16_t *groups);
......
...@@ -793,12 +793,10 @@ static enum pm_ret_status pm_clock_get_num_clocks(uint32_t *nclocks) ...@@ -793,12 +793,10 @@ static enum pm_ret_status pm_clock_get_num_clocks(uint32_t *nclocks)
* *
* This function is used by master to get nmae of clock specified * This function is used by master to get nmae of clock specified
* by given clock ID. * by given clock ID.
*
* @return Returns status, either success or error+reason
*/ */
static enum pm_ret_status pm_clock_get_name(unsigned int clock_id, char *name) static void pm_clock_get_name(unsigned int clock_id, char *name)
{ {
return pm_api_clock_get_name(clock_id, name); pm_api_clock_get_name(clock_id, name);
} }
/** /**
...@@ -1235,13 +1233,10 @@ static enum pm_ret_status pm_pinctrl_get_num_function_groups(unsigned int fid, ...@@ -1235,13 +1233,10 @@ static enum pm_ret_status pm_pinctrl_get_num_function_groups(unsigned int fid,
* *
* This function is used by master to get name of function specified * This function is used by master to get name of function specified
* by given function Id * by given function Id
*
* Return: Returns status, either success or error+reason.
*/ */
static enum pm_ret_status pm_pinctrl_get_function_name(unsigned int fid, static void pm_pinctrl_get_function_name(unsigned int fid, char *name)
char *name)
{ {
return pm_api_pinctrl_get_function_name(fid, name); pm_api_pinctrl_get_function_name(fid, name);
} }
/** /**
...@@ -1301,78 +1296,58 @@ static enum pm_ret_status pm_pinctrl_get_pin_groups(unsigned int pin_id, ...@@ -1301,78 +1296,58 @@ static enum pm_ret_status pm_pinctrl_get_pin_groups(unsigned int pin_id,
* @data Returned output data * @data Returned output data
* *
* This function returns requested data. * This function returns requested data.
*
* @return Returns status, either success or error+reason
*/ */
enum pm_ret_status pm_query_data(enum pm_query_id qid, void pm_query_data(enum pm_query_id qid, unsigned int arg1, unsigned int arg2,
unsigned int arg1, unsigned int arg3, unsigned int *data)
unsigned int arg2,
unsigned int arg3,
unsigned int *data)
{ {
enum pm_ret_status ret;
switch (qid) { switch (qid) {
case PM_QID_CLOCK_GET_NAME: case PM_QID_CLOCK_GET_NAME:
ret = pm_clock_get_name(arg1, (char *)data); pm_clock_get_name(arg1, (char *)data);
break; break;
case PM_QID_CLOCK_GET_TOPOLOGY: case PM_QID_CLOCK_GET_TOPOLOGY:
ret = pm_clock_get_topology(arg1, arg2, &data[1]); data[0] = pm_clock_get_topology(arg1, arg2, &data[1]);
data[0] = (unsigned int)ret;
break; break;
case PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS: case PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS:
ret = pm_clock_get_fixedfactor_params(arg1, &data[1], &data[2]); data[0] = pm_clock_get_fixedfactor_params(arg1, &data[1],
data[0] = (unsigned int)ret; &data[2]);
break; break;
case PM_QID_CLOCK_GET_PARENTS: case PM_QID_CLOCK_GET_PARENTS:
ret = pm_clock_get_parents(arg1, arg2, &data[1]); data[0] = pm_clock_get_parents(arg1, arg2, &data[1]);
data[0] = (unsigned int)ret;
break; break;
case PM_QID_CLOCK_GET_ATTRIBUTES: case PM_QID_CLOCK_GET_ATTRIBUTES:
ret = pm_clock_get_attributes(arg1, &data[1]); data[0] = pm_clock_get_attributes(arg1, &data[1]);
data[0] = (unsigned int)ret;
break; break;
case PM_QID_PINCTRL_GET_NUM_PINS: case PM_QID_PINCTRL_GET_NUM_PINS:
ret = pm_pinctrl_get_num_pins(&data[1]); data[0] = pm_pinctrl_get_num_pins(&data[1]);
data[0] = (unsigned int)ret;
break; break;
case PM_QID_PINCTRL_GET_NUM_FUNCTIONS: case PM_QID_PINCTRL_GET_NUM_FUNCTIONS:
ret = pm_pinctrl_get_num_functions(&data[1]); data[0] = pm_pinctrl_get_num_functions(&data[1]);
data[0] = (unsigned int)ret;
break; break;
case PM_QID_PINCTRL_GET_NUM_FUNCTION_GROUPS: case PM_QID_PINCTRL_GET_NUM_FUNCTION_GROUPS:
ret = pm_pinctrl_get_num_function_groups(arg1, &data[1]); data[0] = pm_pinctrl_get_num_function_groups(arg1, &data[1]);
data[0] = (unsigned int)ret;
break; break;
case PM_QID_PINCTRL_GET_FUNCTION_NAME: case PM_QID_PINCTRL_GET_FUNCTION_NAME:
ret = pm_pinctrl_get_function_name(arg1, (char *)data); pm_pinctrl_get_function_name(arg1, (char *)data);
break; break;
case PM_QID_PINCTRL_GET_FUNCTION_GROUPS: case PM_QID_PINCTRL_GET_FUNCTION_GROUPS:
ret = pm_pinctrl_get_function_groups(arg1, arg2, data[0] = pm_pinctrl_get_function_groups(arg1, arg2,
(uint16_t *)&data[1]); (uint16_t *)&data[1]);
data[0] = (unsigned int)ret;
break; break;
case PM_QID_PINCTRL_GET_PIN_GROUPS: case PM_QID_PINCTRL_GET_PIN_GROUPS:
ret = pm_pinctrl_get_pin_groups(arg1, arg2, data[0] = pm_pinctrl_get_pin_groups(arg1, arg2,
(uint16_t *)&data[1]); (uint16_t *)&data[1]);
data[0] = (unsigned int)ret;
break; break;
case PM_QID_CLOCK_GET_NUM_CLOCKS: case PM_QID_CLOCK_GET_NUM_CLOCKS:
ret = pm_clock_get_num_clocks(&data[1]); data[0] = pm_clock_get_num_clocks(&data[1]);
data[0] = (unsigned int)ret;
break; break;
case PM_QID_CLOCK_GET_MAX_DIVISOR: case PM_QID_CLOCK_GET_MAX_DIVISOR:
ret = pm_clock_get_max_divisor(arg1, arg2, &data[1]); data[0] = pm_clock_get_max_divisor(arg1, arg2, &data[1]);
data[0] = (unsigned int)ret;
break; break;
default: default:
ret = PM_RET_ERROR_ARGS; data[0] = PM_RET_ERROR_ARGS;
WARN("Unimplemented query service call: 0x%x\n", qid); WARN("Unimplemented query service call: 0x%x\n", qid);
break;
} }
return ret;
} }
enum pm_ret_status pm_sha_hash(uint32_t address_high, enum pm_ret_status pm_sha_hash(uint32_t address_high,
......
...@@ -151,11 +151,8 @@ enum pm_ret_status pm_clock_setparent(unsigned int clock_id, ...@@ -151,11 +151,8 @@ enum pm_ret_status pm_clock_setparent(unsigned int clock_id,
unsigned int parent_id); unsigned int parent_id);
enum pm_ret_status pm_clock_getparent(unsigned int clock_id, enum pm_ret_status pm_clock_getparent(unsigned int clock_id,
unsigned int *parent_id); unsigned int *parent_id);
enum pm_ret_status pm_query_data(enum pm_query_id qid, void pm_query_data(enum pm_query_id qid, unsigned int arg1, unsigned int arg2,
unsigned int arg1, unsigned int arg3, unsigned int *data);
unsigned int arg2,
unsigned int arg3,
unsigned int *data);
enum pm_ret_status pm_sha_hash(uint32_t address_high, enum pm_ret_status pm_sha_hash(uint32_t address_high,
uint32_t address_low, uint32_t address_low,
uint32_t size, uint32_t size,
......
...@@ -474,8 +474,8 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, ...@@ -474,8 +474,8 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
{ {
uint32_t data[4] = { 0 }; uint32_t data[4] = { 0 };
ret = pm_query_data(pm_arg[0], pm_arg[1], pm_arg[2], pm_query_data(pm_arg[0], pm_arg[1], pm_arg[2],
pm_arg[3], data); pm_arg[3], data);
SMC_RET2(handle, (uint64_t)data[0] | ((uint64_t)data[1] << 32), SMC_RET2(handle, (uint64_t)data[0] | ((uint64_t)data[1] << 32),
(uint64_t)data[2] | ((uint64_t)data[3] << 32)); (uint64_t)data[2] | ((uint64_t)data[3] << 32));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment