Commit d668b4f3 authored by Krzysztof Opasiak's avatar Krzysztof Opasiak Committed by Felipe Balbi

usb: gadget: FunctionFS: Return -ENOENT instead of -ENODEV when device not found.

Syscall mount returns -ENODEV error if requested FS type
has not been found. Returning the same error from FFS mount
callback makes value returned to userspace misleading.

Other file systems returns -ENOENT if requested device
has not been found. Adjust FFS to this convention to make
error codes meaningfull.
Acked-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarKrzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 50f741c8
...@@ -2899,12 +2899,12 @@ static void *ffs_acquire_dev(const char *dev_name) ...@@ -2899,12 +2899,12 @@ static void *ffs_acquire_dev(const char *dev_name)
ffs_dev = _ffs_find_dev(dev_name); ffs_dev = _ffs_find_dev(dev_name);
if (!ffs_dev) if (!ffs_dev)
ffs_dev = ERR_PTR(-ENODEV); ffs_dev = ERR_PTR(-ENOENT);
else if (ffs_dev->mounted) else if (ffs_dev->mounted)
ffs_dev = ERR_PTR(-EBUSY); ffs_dev = ERR_PTR(-EBUSY);
else if (ffs_dev->ffs_acquire_dev_callback && else if (ffs_dev->ffs_acquire_dev_callback &&
ffs_dev->ffs_acquire_dev_callback(ffs_dev)) ffs_dev->ffs_acquire_dev_callback(ffs_dev))
ffs_dev = ERR_PTR(-ENODEV); ffs_dev = ERR_PTR(-ENOENT);
else else
ffs_dev->mounted = true; ffs_dev->mounted = true;
......
...@@ -276,7 +276,7 @@ module_exit(gfs_exit); ...@@ -276,7 +276,7 @@ module_exit(gfs_exit);
static void *functionfs_acquire_dev(struct ffs_dev *dev) static void *functionfs_acquire_dev(struct ffs_dev *dev)
{ {
if (!try_module_get(THIS_MODULE)) if (!try_module_get(THIS_MODULE))
return ERR_PTR(-ENODEV); return ERR_PTR(-ENOENT);
return 0; return 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