]> err.no Git - linux-2.6/blobdiff - drivers/s390/cio/device.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[linux-2.6] / drivers / s390 / cio / device.c
index 215d27dba9e20dca35462a11eeee5c3c3976f7b3..e818d0c54c0949f5a21ae134ccf426da5d079d9c 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/cio.h>
 #include <asm/param.h>         /* HZ */
 #include <asm/cmb.h>
+#include <asm/isc.h>
 
 #include "chp.h"
 #include "cio.h"
@@ -127,11 +128,18 @@ static int io_subchannel_probe(struct subchannel *);
 static int io_subchannel_remove(struct subchannel *);
 static void io_subchannel_shutdown(struct subchannel *);
 static int io_subchannel_sch_event(struct subchannel *, int);
-static int io_subchannel_chp_event(struct subchannel *, void *, 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,
@@ -485,25 +493,22 @@ static int online_store_recog_and_online(struct ccw_device *cdev)
                ccw_device_set_online(cdev);
        return 0;
 }
-static void online_store_handle_online(struct ccw_device *cdev, int force)
+static int online_store_handle_online(struct ccw_device *cdev, int force)
 {
        int ret;
 
        ret = online_store_recog_and_online(cdev);
        if (ret)
-               return;
+               return ret;
        if (force && cdev->private->state == DEV_STATE_BOXED) {
                ret = ccw_device_stlck(cdev);
-               if (ret) {
-                       dev_warn(&cdev->dev,
-                                "ccw_device_stlck returned %d!\n", ret);
-                       return;
-               }
+               if (ret)
+                       return ret;
                if (cdev->id.cu_type == 0)
                        cdev->private->state = DEV_STATE_NOT_OPER;
                online_store_recog_and_online(cdev);
        }
-
+       return 0;
 }
 
 static ssize_t online_store (struct device *dev, struct device_attribute *attr,
@@ -536,8 +541,9 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr,
                ret = count;
                break;
        case 1:
-               online_store_handle_online(cdev, force);
-               ret = count;
+               ret = online_store_handle_online(cdev, force);
+               if (!ret)
+                       ret = count;
                break;
        default:
                ret = -EINVAL;
@@ -1121,7 +1127,7 @@ static void io_subchannel_init_fields(struct subchannel *sch)
        else
                sch->opm = chp_get_sch_opm(sch);
        sch->lpm = sch->schib.pmcw.pam & sch->opm;
-       sch->isc = cio_is_console(sch->schid) ? 1 : 3;
+       sch->isc = cio_is_console(sch->schid) ? CONSOLE_ISC : IO_SCH_ISC;
 
        CIO_MSG_EVENT(6, "Detected device %04x on subchannel 0.%x.%04X"
                      " - PIM = %02X, PAM = %02X, POM = %02X\n",
@@ -1328,14 +1334,12 @@ static void io_subchannel_terminate_path(struct subchannel *sch, u8 mask)
 
 }
 
-static int io_subchannel_chp_event(struct subchannel *sch, void *data,
-                                  int event)
+static int io_subchannel_chp_event(struct subchannel *sch,
+                                  struct chp_link *link, int event)
 {
        int mask;
-       struct res_acc_data *res_data;
 
-       res_data = data;
-       mask = chp_ssd_get_mask(&sch->ssd_info, res_data);
+       mask = chp_ssd_get_mask(&sch->ssd_info, link);
        if (!mask)
                return 0;
        switch (event) {