9
0
Fork 0

fs: devfs: Allow mount path in cdev_open

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>
This commit is contained in:
Sascha Hauer 2015-10-13 09:35:39 +02:00
parent 7c868bd694
commit 867ada484f
1 changed files with 5 additions and 1 deletions

View File

@ -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;
cdev = cdev_by_name(name);
if (!cdev)
return NULL;