]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/cio/device.c
[S390] cio: Export chsc_error_from_response().
[linux-2.6-omap-h63xx.git] / drivers / s390 / cio / device.c
index 67e7a31239549e4a16c205f5f6a473f096f7e470..e818d0c54c0949f5a21ae134ccf426da5d079d9c 100644 (file)
@@ -128,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,
@@ -486,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,
@@ -537,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;
@@ -1329,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) {