Update the driver path and set binary_updated when we encounter a driver with

the same name but different path. In case of usb_disk that is now loaded as
a boot module the driver got registered with a different path, which prevented
later rescans from working. USB mass storage should now work again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25862 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2008-06-08 14:09:51 +00:00
parent 4ca876701d
commit 139e442a62
@@ -581,6 +581,17 @@ add_driver(const char *path, image_id image)
get_leaf(path));
if (driver != NULL) {
// we know this driver
if (strcmp(driver->path, path) != 0) {
// TODO: do properly, but for now we just update the path if it
// isn't the same anymore so rescanning of drivers will work in
// case this driver was loaded so early that it has a boot module
// path and not a proper driver path
free((char *)driver->path);
driver->path = strdup(path);
driver->name = get_leaf(driver->path);
driver->binary_updated = true;
}
// TODO: check if this driver is a different one and has precendence
// (ie. common supersedes system).
//dprintf("new driver has priority %ld, old %ld\n", priority, driver->priority);