chiark / gitweb /
[PATCH] add bus id modifier
authorarnd@arndb.de <arnd@arndb.de>
Wed, 19 Nov 2003 05:36:10 +0000 (21:36 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:06:24 +0000 (21:06 -0700)
On Tuesday 18 November 2003 02:14, Greg KH wrote:
> On Mon, Nov 17, 2003 at 06:33:32PM +0100, Arnd Bergmann wrote:
> > That would at least be part of the solution I'm looking for. How about
> > extra format characters for bus_id and for the result of a callout
> > program?
>
> Sure, I can see the use for that.  Want to send a patch?  :)

> Take a look at the current bk tree (which has moved to
> bk://linuxusb.bkbits.net/udev/ )  I've made finding that device a lot
> easier now, and it works for all rule types.

Great, just what I was missing. I didn't see the any link to the bk
repository. Here's the patch for the bus_id. I'll need to think about
the handling of callout results a bit more.

namedev.c

index dc56432e674ed70988840d4f007f0d1241f5e282..5970ef059053cff1fc6195123bacc753529b145f 100644 (file)
--- a/namedev.c
+++ b/namedev.c
@@ -822,6 +822,13 @@ done:
                        strcpy(name, pos+2);
                        *pos = 0x00;
                        switch (pos[1]) {
                        strcpy(name, pos+2);
                        *pos = 0x00;
                        switch (pos[1]) {
+                       case 'b':
+                               if (!sysfs_device)
+                                       break;
+                               strcat(udev->name, sysfs_device->bus_id);
+                               dbg("bus_id appended: %s", 
+                                               sysfs_device->bus_id);
+                               break;
                        case 'n':
                                dig = class_dev->name + strlen(class_dev->name);
                                while (isdigit(*(dig-1)))
                        case 'n':
                                dig = class_dev->name + strlen(class_dev->name);
                                while (isdigit(*(dig-1)))