chiark / gitweb /
path_id: add platform and serio support
authorLibor Klepac <libor.klepac@bcom.cz>
Tue, 9 May 2006 16:23:20 +0000 (18:23 +0200)
committerKay Sievers <kay.sievers@suse.de>
Tue, 9 May 2006 16:23:20 +0000 (18:23 +0200)
extras/path_id/path_id

index 7f0d53a..913c490 100644 (file)
@@ -96,6 +96,56 @@ handle_pci () {
        RESULT=0
 }
 
+handle_platform () {
+       local DEV=$1
+       cd -P $1
+       DEV=${PWD}
+       platform_id=${DEV##*/}
+       host_dev_path=$DEV
+       while [ ! -z "$host_dev_path" ] ; do
+               case "$host_dev_path" in
+                       */platform*)
+                               host_dev_path=${host_dev_path%/*}
+                               ;;
+                       *)
+                               break
+                               ;;
+               esac
+       done
+       if [ "$d" ]; then
+               d="platform-$platform_id-$d"
+       else
+               d="platform-$platform_id"
+       fi
+       D="$host_dev_path"
+       RESULT=0
+}
+
+handle_serio () {
+       local DEV=$1
+       cd -P $1
+       DEV=${PWD}
+       serio_id=${DEV##*/serio}
+       host_dev_path=$DEV
+       while [ ! -z "$host_dev_path" ] ; do
+               case "$host_dev_path" in
+                       */serio*)
+                               host_dev_path=${host_dev_path%/*}
+                               ;;
+                       *)
+                               break
+                               ;;
+               esac
+       done
+       if [ "$d" ]; then
+               d="serio-$serio_id-$d"
+       else
+               d="serio-$serio_id"
+       fi
+       D="$host_dev_path"
+       RESULT=0
+}
+
 handle_ide () {
        : handle_ide $*
        local DEV=$1
@@ -372,6 +422,12 @@ handle_device () {
                        */pci[0-9]*:[0-9]*)
                                handle_pci "$D"
                                ;;
+                       */serio[0-9]*)
+                               handle_serio "$D"
+                               ;;
+                       */platform/*)
+                               handle_platform "$D"
+                               ;;
                        */devices)
                                D=
                                ;;