]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev/path-id: comment why USB host number is dropped from the PATH_ID 21620/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 6 Dec 2021 07:05:35 +0000 (16:05 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 6 Dec 2021 07:06:04 +0000 (16:06 +0900)
Closes #21617.

The comment is borrowed from https://github.com/systemd/systemd/pull/21620#discussion_r762521508.

src/udev/udev-builtin-path_id.c

index 9f71fadeea8b1f31446be24d0fc3adaabcaf33d5..6fdd3eceea3176bab212ad2cf912cc5b4b84298f 100644 (file)
@@ -503,6 +503,10 @@ static sd_device *handle_usb(sd_device *parent, char **path) {
                 return parent;
         port++;
 
+        /* USB host number may change across reboots (and probably even without reboot). The part after
+         * USB host number is determined by device topology and so does not change. Hence, drop the
+         * host number and always use '0' instead. */
+
         path_prepend(path, "usb-0:%s", port);
         return skip_subsystem(parent, "usb");
 }