Add a flag in bus_type, so we can quickly identify the bus type. Only adds limited bus types currently. --- 2.6-root/drivers/ide/ide.c | 1 + 2.6-root/drivers/pci/pci-driver.c | 1 + 2.6-root/drivers/pnp/driver.c | 1 + 2.6-root/include/linux/device.h | 9 +++++++++ 4 files changed, 12 insertions(+) diff -puN include/linux/device.h~devcore-addflag include/linux/device.h --- 2.6/include/linux/device.h~devcore-addflag 2004-11-09 12:16:58.000000000 +0800 +++ 2.6-root/include/linux/device.h 2004-11-09 14:43:13.000000000 +0800 @@ -47,8 +47,17 @@ struct class; struct class_device; struct class_simple; +enum bus_types { + BUS_TYPE_PCI = 1, + BUS_TYPE_IDE, + BUS_TYPE_PLATFORM, + BUS_TYPE_PNP, + /* TBD: add more */ +}; + struct bus_type { char * name; + enum bus_types type; struct subsystem subsys; struct kset drivers; diff -puN drivers/pci/pci-driver.c~devcore-addflag drivers/pci/pci-driver.c --- 2.6/drivers/pci/pci-driver.c~devcore-addflag 2004-11-09 12:19:13.000000000 +0800 +++ 2.6-root/drivers/pci/pci-driver.c 2004-11-09 12:19:58.000000000 +0800 @@ -532,6 +532,7 @@ int pci_hotplug (struct device *dev, cha struct bus_type pci_bus_type = { .name = "pci", + .type = BUS_TYPE_PCI, .match = pci_bus_match, .hotplug = pci_hotplug, .suspend = pci_device_suspend, diff -puN drivers/ide/ide.c~devcore-addflag drivers/ide/ide.c --- 2.6/drivers/ide/ide.c~devcore-addflag 2004-11-09 12:20:55.000000000 +0800 +++ 2.6-root/drivers/ide/ide.c 2004-11-09 12:21:30.000000000 +0800 @@ -2414,6 +2414,7 @@ EXPORT_SYMBOL(ide_lock); struct bus_type ide_bus_type = { .name = "ide", + .type = BUS_TYPE_IDE, .suspend = generic_ide_suspend, .resume = generic_ide_resume, }; diff -puN drivers/pnp/driver.c~devcore-addflag drivers/pnp/driver.c --- 2.6/drivers/pnp/driver.c~devcore-addflag 2004-11-09 14:52:31.000000000 +0800 +++ 2.6-root/drivers/pnp/driver.c 2004-11-09 14:53:10.000000000 +0800 @@ -156,6 +156,7 @@ static int pnp_bus_match(struct device * struct bus_type pnp_bus_type = { .name = "pnp", + .type = BUS_TYPE_PNP, .match = pnp_bus_match, }; _