Re: [PATCH] usb: gadget: FunctionFS: Return -ENOENT instead of -ENODEV when device not found.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 21 2014, Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx> wrote:
> 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.
>
> Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>

Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

> ---
>  drivers/usb/gadget/f_fs.c  |    4 ++--
>  drivers/usb/gadget/g_ffs.c |    2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
> index 74202d6..88d6fa2 100644
> --- a/drivers/usb/gadget/f_fs.c
> +++ b/drivers/usb/gadget/f_fs.c
> @@ -2899,12 +2899,12 @@ static void *ffs_acquire_dev(const char *dev_name)
>  
>  	ffs_dev = _ffs_find_dev(dev_name);
>  	if (!ffs_dev)
> -		ffs_dev = ERR_PTR(-ENODEV);
> +		ffs_dev = ERR_PTR(-ENOENT);
>  	else if (ffs_dev->mounted)
>  		ffs_dev = ERR_PTR(-EBUSY);
>  	else if (ffs_dev->ffs_acquire_dev_callback &&
>  	    ffs_dev->ffs_acquire_dev_callback(ffs_dev))
> -		ffs_dev = ERR_PTR(-ENODEV);
> +		ffs_dev = ERR_PTR(-ENOENT);
>  	else
>  		ffs_dev->mounted = true;
>  
> diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
> index fe12e6a..06acfa5 100644
> --- a/drivers/usb/gadget/g_ffs.c
> +++ b/drivers/usb/gadget/g_ffs.c
> @@ -276,7 +276,7 @@ module_exit(gfs_exit);
>  static void *functionfs_acquire_dev(struct ffs_dev *dev)
>  {
>  	if (!try_module_get(THIS_MODULE))
> -		return ERR_PTR(-ENODEV);
> +		return ERR_PTR(-ENOENT);
>  	
>  	return 0;
>  }
> -- 
> 1.7.9.5

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@xxxxxxxxxx>--<xmpp:mina86@xxxxxxxxxx>--ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux