summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6a7eda3)
raw | patch | inline | side by side (parent: 6a7eda3)
author | Sam Nelson <sam.nelson@ti.com> | |
Tue, 10 May 2016 17:20:23 +0000 (13:20 -0400) | ||
committer | Sam Nelson <sam.nelson@ti.com> | |
Tue, 10 May 2016 17:20:52 +0000 (13:20 -0400) |
Add code to handle uio devices with parent nodes.
The code strips of the hierarchy and create the devices with just the
basic entry name without the parent.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
The code strips of the hierarchy and create the devices with just the
basic entry name without the parent.
Signed-off-by: Sam Nelson <sam.nelson@ti.com>
uio_module_drv.c | patch | blob | history |
diff --git a/uio_module_drv.c b/uio_module_drv.c
index 734a5e0fb7c184763eb7d2790ba48aeda287f756..53b86f9f5f3e3c04f77621a30e8b78a065b73563 100644 (file)
--- a/uio_module_drv.c
+++ b/uio_module_drv.c
int error = 0;
int i;
int irq;
- char *name;
+ char *name, *tmp_name;
if (!np) {
dev_err(dev, "Non dt case not supported\n");
spin_lock_init(&uio_module_drv->lock);
uio_module_drv->flags = 0; /* interrupt is enabled to begin with */
- uio = &uio_module_drv->uio;
+ uio = &uio_module_drv->uio;
+
name = strchr(dev_name(dev), '.');
if (name) {
- uio->name = name + 1;
+ name = name +1;
+ tmp_name = strchr(name, ':');
+ if (tmp_name)
+ uio->name = tmp_name + 1;
+ else
+ uio->name = name;
} else {
name = strchr(dev_name(dev), ':');
if (name)