# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.524.9.11 -> 1.524.9.12 # drivers/usb/core/hub.c 1.31 -> 1.32 # drivers/usb/core/usb.c 1.72 -> 1.72.1.1 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/08/01 david-b@pacbell.net 1.524.9.12 # [PATCH] USB: driverfs paths # # I noticed a minor goof, basically an open issue coming home to # roost. For the root hub, usb_device->devpath was "/" so it # caused problems using devpath when constructing names for # interfaces. Driverfs doesn't reject it, but of course the # resulting directory names can't be used... # # This patch (untested, but compiles) should make devpath in that # case be "0" ... which can't collide with any path through hub # ports (first port == "1") so it's possible to use driverfs # paths again. # -------------------------------------------- # diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c --- a/drivers/usb/core/hub.c Fri Aug 2 11:15:17 2002 +++ b/drivers/usb/core/hub.c Fri Aug 2 11:15:17 2002 @@ -876,10 +876,11 @@ * (quite rare, since most hubs have 4-6 ports). */ pdev = dev->parent; - if (pdev->devpath [0] != '/') /* parent not root */ + if (pdev->devpath [0] != '0') /* parent not root? */ len = snprintf (dev->devpath, sizeof dev->devpath, "%s.%d", pdev->devpath, port + 1); - else /* root == "/", root port 2 == "2", port 3 that hub "/2.3" */ + /* root == "0", root port 2 == "2", port 3 that hub "2.3" */ + else len = snprintf (dev->devpath, sizeof dev->devpath, "%d", port + 1); if (len == sizeof dev->devpath) diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c --- a/drivers/usb/core/usb.c Fri Aug 2 11:15:17 2002 +++ b/drivers/usb/core/usb.c Fri Aug 2 11:15:17 2002 @@ -1014,7 +1014,7 @@ usb_bus_get(bus); if (!parent) - dev->devpath [0] = '/'; + dev->devpath [0] = '0'; dev->bus = bus; dev->parent = parent; atomic_set(&dev->refcnt, 1);