chiark / gitweb /
[PATCH] fix network device naming bug
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Sat, 20 Nov 2004 06:42:19 +0000 (22:42 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 05:30:28 +0000 (22:30 -0700)
udev_lib.c

index d745c9bd8680b0cb1ce1b2417f6cb9cbc8c67f2f..f388d23f3e0e2812aabb5e1fe0b9fed74895c10f 100644 (file)
@@ -40,6 +40,7 @@ void udev_set_values(struct udevice *udev, const char* devpath,
                     const char *subsystem, const char* action)
 {
        memset(udev, 0x00, sizeof(struct udevice));
                     const char *subsystem, const char* action)
 {
        memset(udev, 0x00, sizeof(struct udevice));
+
        if (devpath)
                strfieldcpy(udev->devpath, devpath);
        if (subsystem)
        if (devpath)
                strfieldcpy(udev->devpath, devpath);
        if (subsystem)
@@ -49,17 +50,13 @@ void udev_set_values(struct udevice *udev, const char* devpath,
 
        if (strcmp(udev->subsystem, "block") == 0)
                udev->type = 'b';
 
        if (strcmp(udev->subsystem, "block") == 0)
                udev->type = 'b';
-
-       if (strcmp(udev->subsystem, "net") == 0)
+       else if (strcmp(udev->subsystem, "net") == 0)
                udev->type = 'n';
                udev->type = 'n';
-
-       if (strncmp(udev->devpath, "/block/", 7) == 0)
+       else if (strncmp(udev->devpath, "/block/", 7) == 0)
                udev->type = 'b';
                udev->type = 'b';
-
-       if (strncmp(udev->devpath, "/class/net/", 11) == 0)
+       else if (strncmp(udev->devpath, "/class/net/", 11) == 0)
                udev->type = 'n';
                udev->type = 'n';
-
-       if (strncmp(udev->devpath, "/class/", 7) == 0)
+       else if (strncmp(udev->devpath, "/class/", 7) == 0)
                udev->type = 'c';
 }
 
                udev->type = 'c';
 }