]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/cio/css.c
Driver core: change add_uevent_var to use a struct
[linux-2.6-omap-h63xx.git] / drivers / s390 / cio / css.c
index dfca0ef139fdc374cddc8bb0ef452b24a10ccd78..5635e656c1a369b92bd0027c0e8beca261baed3c 100644 (file)
@@ -79,6 +79,7 @@ css_alloc_subchannel(struct subchannel_id schid)
        sch->schib.pmcw.intparm = (__u32)(unsigned long)sch;
        ret = cio_modify(sch);
        if (ret) {
+               kfree(sch->lock);
                kfree(sch);
                return ERR_PTR(ret);
        }
@@ -109,7 +110,7 @@ css_subchannel_release(struct device *dev)
        }
 }
 
-int css_sch_device_register(struct subchannel *sch)
+static int css_sch_device_register(struct subchannel *sch)
 {
        int ret;
 
@@ -184,8 +185,8 @@ static int css_register_subchannel(struct subchannel *sch)
        /* make it known to the system */
        ret = css_sch_device_register(sch);
        if (ret) {
-               printk (KERN_WARNING "%s: could not register %s\n",
-                       __func__, sch->dev.bus_id);
+               CIO_MSG_EVENT(0, "Could not register sch 0.%x.%04x: %d\n",
+                             sch->schid.ssid, sch->schid.sch_no, ret);
                return ret;
        }
        return ret;
@@ -371,15 +372,12 @@ static int __init slow_subchannel_init(void)
        spin_lock_init(&slow_subchannel_lock);
        slow_subchannel_set = idset_sch_new();
        if (!slow_subchannel_set) {
-               printk(KERN_WARNING "cio: could not allocate slow subchannel "
-                      "set\n");
+               CIO_MSG_EVENT(0, "could not allocate slow subchannel set\n");
                return -ENOMEM;
        }
        return 0;
 }
 
-subsys_initcall(slow_subchannel_init);
-
 static void css_slow_path_func(struct work_struct *unused)
 {
        struct subchannel_id schid;
@@ -425,8 +423,8 @@ static int reprobe_subchannel(struct subchannel_id schid, void *data)
        struct subchannel *sch;
        int ret;
 
-       CIO_DEBUG(KERN_INFO, 6, "cio: reprobe 0.%x.%04x\n",
-                 schid.ssid, schid.sch_no);
+       CIO_MSG_EVENT(6, "cio: reprobe 0.%x.%04x\n",
+                     schid.ssid, schid.sch_no);
        if (need_reprobe)
                return -EAGAIN;
 
@@ -642,9 +640,20 @@ init_channel_subsystem (void)
 {
        int ret, i;
 
-       if (chsc_determine_css_characteristics() == 0)
+       ret = chsc_determine_css_characteristics();
+       if (ret == -ENOMEM)
+               goto out; /* No need to continue. */
+       if (ret == 0)
                css_characteristics_avail = 1;
 
+       ret = chsc_alloc_sei_area();
+       if (ret)
+               goto out;
+
+       ret = slow_subchannel_init();
+       if (ret)
+               goto out;
+
        if ((ret = bus_register(&css_bus_type)))
                goto out;
 
@@ -710,6 +719,10 @@ out_unregister:
 out_bus:
        bus_unregister(&css_bus_type);
 out:
+       chsc_free_sei_area();
+       kfree(slow_subchannel_set);
+       printk(KERN_WARNING"cio: failed to initialize css driver (%d)!\n",
+              ret);
        return ret;
 }