Commit 70b2e179 authored by Suman Anna's avatar Suman Anna Committed by Hari Kanigeri

SYSLINK: ipc - fixed return status for gatepeterson_open

This patch fixes the issues with the status returned from kernel
for gatepeterson_open. The following are the changes.
1. gatepeterson_open - changed the ENOENT to ENXIO, as ENOENT might
   be returned from nameserver and will translate to a different error
   code in user-space
2. gatepeterson_ioctl_open - returning the status of gatepeterson_open
   to the user-level in api_status.
Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
parent ec3471e6
...@@ -589,7 +589,7 @@ int gatepeterson_open(void **gphandle, ...@@ -589,7 +589,7 @@ int gatepeterson_open(void **gphandle,
if (unlikely(((struct gatepeterson_attrs *)sharedaddr)->status != if (unlikely(((struct gatepeterson_attrs *)sharedaddr)->status !=
GATEPETERSON_CREATED)) { GATEPETERSON_CREATED)) {
retval = -ENOENT; /* Not created */ retval = -ENXIO; /* Not created */
goto noentry_fail; goto noentry_fail;
} }
...@@ -698,8 +698,7 @@ handle_alloc_fail: /* Fall through */ ...@@ -698,8 +698,7 @@ handle_alloc_fail: /* Fall through */
noentry_fail: /* Fall through */ noentry_fail: /* Fall through */
exit: exit:
printk(KERN_ERR "gatepeterson_open failed status: %x\n", retval); printk(KERN_ERR "gatepeterson_open failed status: %x\n", retval);
return retval;; return retval;
} }
EXPORT_SYMBOL(gatepeterson_open); EXPORT_SYMBOL(gatepeterson_open);
......
...@@ -206,9 +206,8 @@ static int gatepeterson_ioctl_open(struct gatepeterson_cmd_args *cargs) ...@@ -206,9 +206,8 @@ static int gatepeterson_ioctl_open(struct gatepeterson_cmd_args *cargs)
} }
params.shared_addr = sharedregion_get_ptr((u32 *)params.shared_addr); params.shared_addr = sharedregion_get_ptr((u32 *)params.shared_addr);
status = gatepeterson_open(&handle, &params); cargs->api_status = gatepeterson_open(&handle, &params);
cargs->args.open.handle = handle; cargs->args.open.handle = handle;
cargs->api_status = 0;
name_from_usr_error: name_from_usr_error:
if (cargs->args.open.name_len > 0) if (cargs->args.open.name_len > 0)
......
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