[PATCH 07/32] staging: gasket: Return EBUSY on mapping create when already in use

From: Todd Poynor
Date: Tue Jul 17 2018 - 17:07:27 EST


From: Todd Poynor <toddpoynor@xxxxxxxxxx>

gasket_sysfs_create_mapping() return EBUSY if sysfs mapping already in
use, as a more appropriate error code than the current return of EINVAL,
which would indicate invalid parameters.

Signed-off-by: Zhongze Hu <frankhu@xxxxxxxxxxxx>
Signed-off-by: Todd Poynor <toddpoynor@xxxxxxxxxx>
---
drivers/staging/gasket/gasket_sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gasket/gasket_sysfs.c b/drivers/staging/gasket/gasket_sysfs.c
index e3d770630961b..dd4d3aaa57e2f 100644
--- a/drivers/staging/gasket/gasket_sysfs.c
+++ b/drivers/staging/gasket/gasket_sysfs.c
@@ -194,7 +194,7 @@ int gasket_sysfs_create_mapping(
"0x%p.", device);
put_mapping(mapping);
mutex_unlock(&function_mutex);
- return -EINVAL;
+ return -EBUSY;
}

/* Find the first empty entry in the array. */
--
2.18.0.203.gfac676dfb9-goog