aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Herbrechtsmeier2023-05-23 14:42:10 +0200
committerMichal Simek2023-06-12 13:25:01 +0200
commitee3c02af77178133b1f4e0446bba58f6ce0888e0 (patch)
treee5d68797b21a4bc593136f496b490c33ce0572c3
parent999ac2c37ae12df4e889a968056d409c55d38cd7 (diff)
firmware: zynqmp: Remove extraordinary return value
Return a common -EACCES error value instead of a positive private error value XST_PM_NO_ACCESS (2002) in zynqmp_pmufw_load_config_object function if the config object is not loadable to simplify the error checking. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Link: https://lore.kernel.org/r/20230523124215.30915-1-stefan.herbrechtsmeier-oss@weidmueller.com Signed-off-by: Michal Simek <michal.simek@amd.com>
-rw-r--r--drivers/firmware/firmware-zynqmp.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
index dc8e3ad2b9d..2b1ad5d2c35 100644
--- a/drivers/firmware/firmware-zynqmp.c
+++ b/drivers/firmware/firmware-zynqmp.c
@@ -82,7 +82,7 @@ int zynqmp_pmufw_node(u32 id)
ret = zynqmp_pmufw_load_config_object(xpm_configobject,
sizeof(xpm_configobject));
- if (ret == XST_PM_NO_ACCESS && id == NODE_OCM_BANK_0)
+ if (ret == -EACCES && id == NODE_OCM_BANK_0)
skip_config = true;
return 0;
@@ -235,8 +235,7 @@ int zynqmp_pm_is_function_supported(const u32 api_id, const u32 id)
*
* @cfg_obj: Pointer to the configuration object
* @size: Size of @cfg_obj in bytes
- * Return: 0 on success otherwise negative errno. If the config object
- * is not loadable returns positive errno XST_PM_NO_ACCESS(2002)
+ * Return: 0 on success otherwise negative errno.
*/
int zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size)
{
@@ -251,10 +250,8 @@ int zynqmp_pmufw_load_config_object(const void *cfg_obj, size_t size)
err = xilinx_pm_request(PM_SET_CONFIGURATION, (u32)(u64)cfg_obj, 0, 0,
0, ret_payload);
if (err == XST_PM_NO_ACCESS) {
- if (((u32 *)cfg_obj)[NODE_ID_LOCATION] == NODE_OCM_BANK_0) {
+ if (((u32 *)cfg_obj)[NODE_ID_LOCATION] == NODE_OCM_BANK_0)
printf("PMUFW: No permission to change config object\n");
- return err;
- }
return -EACCES;
}