[USB] Assign proper names to devices. Fix pegasus driver to use it.
authorBalaji Rao <balajirrao@gmail.com>
Wed, 23 Jul 2008 19:40:12 +0000 (01:10 +0530)
committerroot <root@localhost.localdomain>
Wed, 23 Jul 2008 19:40:12 +0000 (01:10 +0530)
src/drivers/bus/usb/usbcore.c
src/drivers/net/usb/pegasus.c

index d47b3c7..473f646 100644 (file)
@@ -44,6 +44,9 @@ int usb_probe (struct usb_device *udev) {
                                continue;
                        udev->driver = driver;
                        udev->driver_name = id->name;
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+                       strncpy(udev->dev.name, id->name,
+                               min(strlen(id->name), sizeof(udev->dev.name)));
                        DBG ("...using driver %s\n", udev->driver_name);
                        if ((rc = driver->probe(udev, id )) != 0) {
                                DBG ("......probe failed\n");
index 5fead0c..25850b2 100644 (file)
@@ -498,7 +498,7 @@ int pegasus_probe(struct usb_device *udev,
        pegasus->udev = udev;
        pegasus->net = netdev;
 
-       /* pegasus->dev = &udev->dev; */
+       netdev->dev = &udev->dev;
 
        for(i = 0;i < udev->num_endpoints; i++) {
                if (usb_ep_xfertype(udev->endpoints[i]) == USB_ENDPOINT_XFER_BULK &&