Messages in this thread Patch in this message | | | Date | Mon, 25 Jul 2005 00:09:04 -0400 | From | Jon Smirl <> | Subject | [PATCH] driver core: Add the ability to unbind drivers to devices from userspace |
| |
I just pulled from GIT to test bind/unbind. I couldn't get it to work; it isn't taking into account the CR on the end of the input value of the sysfs attribute. This patch will fix it but I'm sure there is a cleaner solution.
-- Jon Smirl jonsmirl@gmail.com
diff --git a/drivers/base/bus.c b/drivers/base/bus.c --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -137,9 +137,11 @@ decl_subsys(bus, &ktype_bus, NULL); static int driver_helper(struct device *dev, void *data) { const char *name = data; - - if (strcmp(name, dev->bus_id) == 0) +printk(KERN_ERR "unbind: %s %s\n", name, dev->bus_id); + if (strncmp(name, dev->bus_id, strlen(dev->bus_id)) == 0) { +printk(KERN_ERR "match\n"); return 1; + } return 0; } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |