diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2007-07-27 06:29:21 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-07-27 06:29:20 -0400 |
commit | 4434a38c37dd30e5cd01456a136367a43d8da2dd (patch) | |
tree | 7597941ae953297e8f8531e995d9b0c2e9a114a3 /drivers/s390/cio | |
parent | 303fa9e39605c1d56971dd22cd04d2186dc42c98 (diff) |
[S390] cio: Reorganize initialization.
- 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>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/chsc.c | 10 | ||||
-rw-r--r-- | drivers/s390/cio/chsc.h | 2 | ||||
-rw-r--r-- | drivers/s390/cio/css.c | 19 |
3 files changed, 24 insertions, 7 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index b38dc2478541..597c0c76a2ad 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c | |||
@@ -990,8 +990,7 @@ out: | |||
990 | return ret; | 990 | return ret; |
991 | } | 991 | } |
992 | 992 | ||
993 | static int __init | 993 | int __init chsc_alloc_sei_area(void) |
994 | chsc_alloc_sei_area(void) | ||
995 | { | 994 | { |
996 | sei_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); | 995 | sei_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); |
997 | if (!sei_page) | 996 | if (!sei_page) |
@@ -1000,6 +999,11 @@ chsc_alloc_sei_area(void) | |||
1000 | return (sei_page ? 0 : -ENOMEM); | 999 | return (sei_page ? 0 : -ENOMEM); |
1001 | } | 1000 | } |
1002 | 1001 | ||
1002 | void __init chsc_free_sei_area(void) | ||
1003 | { | ||
1004 | kfree(sei_page); | ||
1005 | } | ||
1006 | |||
1003 | int __init | 1007 | int __init |
1004 | chsc_enable_facility(int operation_code) | 1008 | chsc_enable_facility(int operation_code) |
1005 | { | 1009 | { |
@@ -1051,8 +1055,6 @@ chsc_enable_facility(int operation_code) | |||
1051 | return ret; | 1055 | return ret; |
1052 | } | 1056 | } |
1053 | 1057 | ||
1054 | subsys_initcall(chsc_alloc_sei_area); | ||
1055 | |||
1056 | struct css_general_char css_general_characteristics; | 1058 | struct css_general_char css_general_characteristics; |
1057 | struct css_chsc_char css_chsc_characteristics; | 1059 | struct css_chsc_char css_chsc_characteristics; |
1058 | 1060 | ||
diff --git a/drivers/s390/cio/chsc.h b/drivers/s390/cio/chsc.h index 2ad81d11cf7b..d1f5db1e69b9 100644 --- a/drivers/s390/cio/chsc.h +++ b/drivers/s390/cio/chsc.h | |||
@@ -79,6 +79,8 @@ extern int chsc_get_ssd_info(struct subchannel_id schid, | |||
79 | struct chsc_ssd_info *ssd); | 79 | struct chsc_ssd_info *ssd); |
80 | extern int chsc_determine_css_characteristics(void); | 80 | extern int chsc_determine_css_characteristics(void); |
81 | extern int css_characteristics_avail; | 81 | extern int css_characteristics_avail; |
82 | extern int chsc_alloc_sei_area(void); | ||
83 | extern void chsc_free_sei_area(void); | ||
82 | 84 | ||
83 | extern int chsc_enable_facility(int); | 85 | extern int chsc_enable_facility(int); |
84 | struct channel_subsystem; | 86 | struct channel_subsystem; |
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index ac5ceb933896..1c27a5a06b49 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -377,8 +377,6 @@ static int __init slow_subchannel_init(void) | |||
377 | return 0; | 377 | return 0; |
378 | } | 378 | } |
379 | 379 | ||
380 | subsys_initcall(slow_subchannel_init); | ||
381 | |||
382 | static void css_slow_path_func(struct work_struct *unused) | 380 | static void css_slow_path_func(struct work_struct *unused) |
383 | { | 381 | { |
384 | struct subchannel_id schid; | 382 | struct subchannel_id schid; |
@@ -641,9 +639,20 @@ init_channel_subsystem (void) | |||
641 | { | 639 | { |
642 | int ret, i; | 640 | int ret, i; |
643 | 641 | ||
644 | if (chsc_determine_css_characteristics() == 0) | 642 | ret = chsc_determine_css_characteristics(); |
643 | if (ret == -ENOMEM) | ||
644 | goto out; /* No need to continue. */ | ||
645 | if (ret == 0) | ||
645 | css_characteristics_avail = 1; | 646 | css_characteristics_avail = 1; |
646 | 647 | ||
648 | ret = chsc_alloc_sei_area(); | ||
649 | if (ret) | ||
650 | goto out; | ||
651 | |||
652 | ret = slow_subchannel_init(); | ||
653 | if (ret) | ||
654 | goto out; | ||
655 | |||
647 | if ((ret = bus_register(&css_bus_type))) | 656 | if ((ret = bus_register(&css_bus_type))) |
648 | goto out; | 657 | goto out; |
649 | 658 | ||
@@ -709,6 +718,10 @@ out_unregister: | |||
709 | out_bus: | 718 | out_bus: |
710 | bus_unregister(&css_bus_type); | 719 | bus_unregister(&css_bus_type); |
711 | out: | 720 | out: |
721 | chsc_free_sei_area(); | ||
722 | kfree(slow_subchannel_set); | ||
723 | printk(KERN_WARNING"cio: failed to initialize css driver (%d)!\n", | ||
724 | ret); | ||
712 | return ret; | 725 | return ret; |
713 | } | 726 | } |
714 | 727 | ||