]> err.no Git - linux-2.6/commitdiff
[S390] cio: Reorganize initialization.
authorCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 27 Jul 2007 10:29:21 +0000 (12:29 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 27 Jul 2007 10:29:20 +0000 (12:29 +0200)
- Localize more of the init calls in init_channel_subsystem().
- Print a warning if init_channel_subsystem() failed.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/chsc.c
drivers/s390/cio/chsc.h
drivers/s390/cio/css.c

index b38dc2478541e8bea420f707b5bc3dd8674f01f4..597c0c76a2adcaf12cc228465b6f363a8a528626 100644 (file)
@@ -990,8 +990,7 @@ out:
        return ret;
 }
 
-static int __init
-chsc_alloc_sei_area(void)
+int __init chsc_alloc_sei_area(void)
 {
        sei_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
        if (!sei_page)
@@ -1000,6 +999,11 @@ chsc_alloc_sei_area(void)
        return (sei_page ? 0 : -ENOMEM);
 }
 
+void __init chsc_free_sei_area(void)
+{
+       kfree(sei_page);
+}
+
 int __init
 chsc_enable_facility(int operation_code)
 {
@@ -1051,8 +1055,6 @@ chsc_enable_facility(int operation_code)
        return ret;
 }
 
-subsys_initcall(chsc_alloc_sei_area);
-
 struct css_general_char css_general_characteristics;
 struct css_chsc_char css_chsc_characteristics;
 
index 2ad81d11cf7bfa564bdebe1d65085f0e054e3f7f..d1f5db1e69b94d6eee24aef06351fdb515abc1e4 100644 (file)
@@ -79,6 +79,8 @@ extern int chsc_get_ssd_info(struct subchannel_id schid,
                             struct chsc_ssd_info *ssd);
 extern int chsc_determine_css_characteristics(void);
 extern int css_characteristics_avail;
+extern int chsc_alloc_sei_area(void);
+extern void chsc_free_sei_area(void);
 
 extern int chsc_enable_facility(int);
 struct channel_subsystem;
index ac5ceb933896dc4088df1d9f6c600dd91ad0a2dd..1c27a5a06b4982d6f754484f52ad4187b8f9162d 100644 (file)
@@ -377,8 +377,6 @@ static int __init slow_subchannel_init(void)
        return 0;
 }
 
-subsys_initcall(slow_subchannel_init);
-
 static void css_slow_path_func(struct work_struct *unused)
 {
        struct subchannel_id schid;
@@ -641,9 +639,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;
 
@@ -709,6 +718,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;
 }