aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2009-09-22 16:58:37 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-09-22 16:58:42 -0400
commitb0a285d31bd475fdd4312e457288be558b705e55 (patch)
treea8e99fc301bedaff3e141b68f7f16183a810192e /drivers/s390
parentb827d1c8b65b27a293433e7c4723c7dfd6c4b848 (diff)
[S390] cio: idset use actual number of ssids
The functions idset_sch_new and for_each_subchannel_staged use different values for the number of subchannel sets. Make it consistent by changing idset_sch_new to also use the actual number of subchannel sets. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/css.c26
-rw-r--r--drivers/s390/cio/css.h1
-rw-r--r--drivers/s390/cio/idset.c2
3 files changed, 15 insertions, 14 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index b43f769d445e..5e217bbf8797 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -32,7 +32,7 @@
32 32
33int css_init_done = 0; 33int css_init_done = 0;
34static int need_reprobe = 0; 34static int need_reprobe = 0;
35static int max_ssid = 0; 35int max_ssid;
36 36
37struct channel_subsystem *channel_subsystems[__MAX_CSSID + 1]; 37struct channel_subsystem *channel_subsystems[__MAX_CSSID + 1];
38 38
@@ -879,6 +879,18 @@ static int __init css_bus_init(void)
879 if (ret) 879 if (ret)
880 goto out; 880 goto out;
881 881
882 /* Try to enable MSS. */
883 ret = chsc_enable_facility(CHSC_SDA_OC_MSS);
884 switch (ret) {
885 case 0: /* Success. */
886 max_ssid = __MAX_SSID;
887 break;
888 case -ENOMEM:
889 goto out;
890 default:
891 max_ssid = 0;
892 }
893
882 ret = slow_subchannel_init(); 894 ret = slow_subchannel_init();
883 if (ret) 895 if (ret)
884 goto out; 896 goto out;
@@ -890,17 +902,6 @@ static int __init css_bus_init(void)
890 if ((ret = bus_register(&css_bus_type))) 902 if ((ret = bus_register(&css_bus_type)))
891 goto out; 903 goto out;
892 904
893 /* Try to enable MSS. */
894 ret = chsc_enable_facility(CHSC_SDA_OC_MSS);
895 switch (ret) {
896 case 0: /* Success. */
897 max_ssid = __MAX_SSID;
898 break;
899 case -ENOMEM:
900 goto out_bus;
901 default:
902 max_ssid = 0;
903 }
904 /* Setup css structure. */ 905 /* Setup css structure. */
905 for (i = 0; i <= __MAX_CSSID; i++) { 906 for (i = 0; i <= __MAX_CSSID; i++) {
906 struct channel_subsystem *css; 907 struct channel_subsystem *css;
@@ -966,7 +967,6 @@ out_unregister:
966 &dev_attr_cm_enable); 967 &dev_attr_cm_enable);
967 device_unregister(&css->device); 968 device_unregister(&css->device);
968 } 969 }
969out_bus:
970 bus_unregister(&css_bus_type); 970 bus_unregister(&css_bus_type);
971out: 971out:
972 crw_unregister_handler(CRW_RSC_CSS); 972 crw_unregister_handler(CRW_RSC_CSS);
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h
index 54acdaade86e..68d6b0bf151c 100644
--- a/drivers/s390/cio/css.h
+++ b/drivers/s390/cio/css.h
@@ -111,6 +111,7 @@ extern void css_sch_device_unregister(struct subchannel *);
111extern int css_probe_device(struct subchannel_id); 111extern int css_probe_device(struct subchannel_id);
112extern struct subchannel *get_subchannel_by_schid(struct subchannel_id); 112extern struct subchannel *get_subchannel_by_schid(struct subchannel_id);
113extern int css_init_done; 113extern int css_init_done;
114extern int max_ssid;
114int for_each_subchannel_staged(int (*fn_known)(struct subchannel *, void *), 115int for_each_subchannel_staged(int (*fn_known)(struct subchannel *, void *),
115 int (*fn_unknown)(struct subchannel_id, 116 int (*fn_unknown)(struct subchannel_id,
116 void *), void *data); 117 void *), void *data);
diff --git a/drivers/s390/cio/idset.c b/drivers/s390/cio/idset.c
index 77e42cb127bb..5c88faf5b897 100644
--- a/drivers/s390/cio/idset.c
+++ b/drivers/s390/cio/idset.c
@@ -78,7 +78,7 @@ static inline int idset_get_first(struct idset *set, int *ssid, int *id)
78 78
79struct idset *idset_sch_new(void) 79struct idset *idset_sch_new(void)
80{ 80{
81 return idset_new(__MAX_SSID + 1, __MAX_SUBCHANNEL + 1); 81 return idset_new(max_ssid + 1, __MAX_SUBCHANNEL + 1);
82} 82}
83 83
84void idset_sch_add(struct idset *set, struct subchannel_id schid) 84void idset_sch_add(struct idset *set, struct subchannel_id schid)