Re: [PATCH 2/4] fs: devfs: Allow mount path in cdev_open

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

 



On Tue, Oct 13, 2015 at 09:51:52AM +0200, Sascha Hauer wrote:
> When opening a cdev also allow a path beginning with /dev/ as some
> users of cdev_open already open coded this behaviour.
> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> ---
>  fs/devfs-core.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/devfs-core.c b/fs/devfs-core.c
> index 62571fb..26f56d9 100644
> --- a/fs/devfs-core.c
> +++ b/fs/devfs-core.c
> @@ -121,9 +121,13 @@ int cdev_do_open(struct cdev *cdev, unsigned long flags)
>  
>  struct cdev *cdev_open(const char *name, unsigned long flags)
>  {
> -	struct cdev *cdev = cdev_by_name(name);
> +	struct cdev *cdev;
>  	int ret;
>  
> +	if (strncmp(name, "/dev/", 5))
> +		name += 5;

And with the missing '!' before strncmp this works as expected.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux