aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/css.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-07-12 11:30:57 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-12 11:30:57 -0400
commitb2d6744849b5bf6b4593b81c136772df7a238ac9 (patch)
treef27260a0b16412449c4205207af114646c29e2c4 /drivers/s390/cio/css.c
parentc67646641cab01c93a56674bfcd963f55442dad5 (diff)
parentd2c993d845781d160a7ef759a3e65c6892c4a270 (diff)
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: [S390] Fix sparse warnings. [S390] path grouping and path verifications fixes. [S390] xpram module parameter parsing. [S390] cpu_relax() is supposed to have barrier() semantics. [S390] fix futex_atomic_cmpxchg_inatomic [S390] subchannel register/unregister mutex. [S390] raw_local_save_flags/raw_local_irq_restore type check [S390] __builtin_trap() and gcc version.
Diffstat (limited to 'drivers/s390/cio/css.c')
-rw-r--r--drivers/s390/cio/css.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 1d3be80797f8..13eeea3d547f 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -108,6 +108,24 @@ css_subchannel_release(struct device *dev)
108 108
109extern int css_get_ssd_info(struct subchannel *sch); 109extern int css_get_ssd_info(struct subchannel *sch);
110 110
111
112int css_sch_device_register(struct subchannel *sch)
113{
114 int ret;
115
116 mutex_lock(&sch->reg_mutex);
117 ret = device_register(&sch->dev);
118 mutex_unlock(&sch->reg_mutex);
119 return ret;
120}
121
122void css_sch_device_unregister(struct subchannel *sch)
123{
124 mutex_lock(&sch->reg_mutex);
125 device_unregister(&sch->dev);
126 mutex_unlock(&sch->reg_mutex);
127}
128
111static int 129static int
112css_register_subchannel(struct subchannel *sch) 130css_register_subchannel(struct subchannel *sch)
113{ 131{
@@ -119,7 +137,7 @@ css_register_subchannel(struct subchannel *sch)
119 sch->dev.release = &css_subchannel_release; 137 sch->dev.release = &css_subchannel_release;
120 138
121 /* make it known to the system */ 139 /* make it known to the system */
122 ret = device_register(&sch->dev); 140 ret = css_sch_device_register(sch);
123 if (ret) 141 if (ret)
124 printk (KERN_WARNING "%s: could not register %s\n", 142 printk (KERN_WARNING "%s: could not register %s\n",
125 __func__, sch->dev.bus_id); 143 __func__, sch->dev.bus_id);
@@ -250,7 +268,7 @@ css_evaluate_subchannel(struct subchannel_id schid, int slow)
250 * The device will be killed automatically. 268 * The device will be killed automatically.
251 */ 269 */
252 cio_disable_subchannel(sch); 270 cio_disable_subchannel(sch);
253 device_unregister(&sch->dev); 271 css_sch_device_unregister(sch);
254 /* Reset intparm to zeroes. */ 272 /* Reset intparm to zeroes. */
255 sch->schib.pmcw.intparm = 0; 273 sch->schib.pmcw.intparm = 0;
256 cio_modify(sch); 274 cio_modify(sch);
@@ -264,7 +282,7 @@ css_evaluate_subchannel(struct subchannel_id schid, int slow)
264 * away in any case. 282 * away in any case.
265 */ 283 */
266 if (!disc) { 284 if (!disc) {
267 device_unregister(&sch->dev); 285 css_sch_device_unregister(sch);
268 /* Reset intparm to zeroes. */ 286 /* Reset intparm to zeroes. */
269 sch->schib.pmcw.intparm = 0; 287 sch->schib.pmcw.intparm = 0;
270 cio_modify(sch); 288 cio_modify(sch);
@@ -605,9 +623,13 @@ init_channel_subsystem (void)
605 ret = device_register(&css[i]->device); 623 ret = device_register(&css[i]->device);
606 if (ret) 624 if (ret)
607 goto out_free; 625 goto out_free;
608 if (css_characteristics_avail && css_chsc_characteristics.secm) 626 if (css_characteristics_avail &&
609 device_create_file(&css[i]->device, 627 css_chsc_characteristics.secm) {
610 &dev_attr_cm_enable); 628 ret = device_create_file(&css[i]->device,
629 &dev_attr_cm_enable);
630 if (ret)
631 goto out_device;
632 }
611 } 633 }
612 css_init_done = 1; 634 css_init_done = 1;
613 635
@@ -615,6 +637,8 @@ init_channel_subsystem (void)
615 637
616 for_each_subchannel(__init_channel_subsystem, NULL); 638 for_each_subchannel(__init_channel_subsystem, NULL);
617 return 0; 639 return 0;
640out_device:
641 device_unregister(&css[i]->device);
618out_free: 642out_free:
619 kfree(css[i]); 643 kfree(css[i]);
620out_unregister: 644out_unregister: