[S390] css: Use css_device_id for bus matching.
authorCornelia Huck <cornelia.huck@de.ibm.com>
Mon, 14 Jul 2008 07:59:03 +0000 (09:59 +0200)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 14 Jul 2008 08:02:12 +0000 (10:02 +0200)
css_device_id exists, so use it for determining the right driver
(and add a match_flags which is always 1 for valid types).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
drivers/s390/cio/css.c
drivers/s390/cio/css.h
drivers/s390/cio/device.c
include/linux/mod_devicetable.h

index 45ba07c0a28629c2bd7c27dd659591db0b659693..4e2f2bbf4ba5172278d65c32fa6985a1caca86f0 100644 (file)
@@ -850,19 +850,16 @@ int sch_is_pseudo_sch(struct subchannel *sch)
        return sch == to_css(sch->dev.parent)->pseudo_subchannel;
 }
 
-/*
- * find a driver for a subchannel. They identify by the subchannel
- * type with the exception that the console subchannel driver has its own
- * subchannel type although the device is an i/o subchannel
- */
-static int
-css_bus_match (struct device *dev, struct device_driver *drv)
+static int css_bus_match(struct device *dev, struct device_driver *drv)
 {
        struct subchannel *sch = to_subchannel(dev);
        struct css_driver *driver = to_cssdriver(drv);
+       struct css_device_id *id;
 
-       if (sch->st == driver->subchannel_type)
-               return 1;
+       for (id = driver->subchannel_type; id->match_flags; id++) {
+               if (sch->st == id->type)
+                       return 1;
+       }
 
        return 0;
 }
index 38bf9ddb8412da9a9e7205458861fec2873f42c6..58020bf41ed02a81776acc0166924538650f907e 100644 (file)
@@ -75,7 +75,7 @@ struct chp_link;
  */
 struct css_driver {
        struct module *owner;
-       unsigned int subchannel_type;
+       struct css_device_id *subchannel_type;
        struct device_driver drv;
        void (*irq)(struct subchannel *);
        int (*chp_event)(struct subchannel *, struct chp_link *, int);
index 522d47afc950d567f9338d963b91fc8da6530adc..c904cb84d75ea3885f09f00f4c8bb39a7fb88fc3 100644 (file)
@@ -131,9 +131,15 @@ static int io_subchannel_sch_event(struct subchannel *, int);
 static int io_subchannel_chp_event(struct subchannel *, struct chp_link *,
                                   int);
 
+static struct css_device_id io_subchannel_ids[] = {
+       { .match_flags = 0x1, .type = SUBCHANNEL_TYPE_IO, },
+       { /* end of list */ },
+};
+MODULE_DEVICE_TABLE(css, io_subchannel_ids);
+
 static struct css_driver io_subchannel_driver = {
        .owner = THIS_MODULE,
-       .subchannel_type = SUBCHANNEL_TYPE_IO,
+       .subchannel_type = io_subchannel_ids,
        .name = "io_subchannel",
        .irq = io_subchannel_irq,
        .sch_event = io_subchannel_sch_event,
index 1fd03e732e07252d361b05c1cb623492530a43ee..c4db5827963d98a5624ec1c8fb637ad959903a75 100644 (file)
@@ -161,8 +161,8 @@ struct ap_device_id {
 
 /* s390 css bus devices (subchannels) */
 struct css_device_id {
+       __u8 match_flags;
        __u8 type; /* subchannel type */
-       __u8 pad1;
        __u16 pad2;
        __u32 pad3;
        kernel_ulong_t driver_data;