mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/4] fs: devfs: Allow mount path in cdev_open
Date: Tue, 13 Oct 2015 10:25:39 +0200	[thread overview]
Message-ID: <20151013082539.GD7858@pengutronix.de> (raw)
In-Reply-To: <1444722714-30445-3-git-send-email-s.hauer@pengutronix.de>

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@pengutronix.de>
> ---
>  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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-10-13  8:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13  7:51 devfs fixes Sascha Hauer
2015-10-13  7:51 ` [PATCH 1/4] fs: devfs: Allow mounting only on /dev/ Sascha Hauer
2015-10-13  7:51 ` [PATCH 2/4] fs: devfs: Allow mount path in cdev_open Sascha Hauer
2015-10-13  8:25   ` Sascha Hauer [this message]
2015-10-13  7:51 ` [PATCH 3/4] filetype: Use cdev_open Sascha Hauer
2015-10-13  7:51 ` [PATCH 4/4] fs: pass path directly to cdev_open Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151013082539.GD7858@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox