aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2007-10-12 10:11:13 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-10-12 10:12:58 -0400
commit7c9f4e3aaae020fc674f52393cbac1bdb648bf90 (patch)
tree4c0fee1179144280a791fae0f2c61ac47b353cf1 /drivers/s390
parent782e3b3b3804c38d5130c7f21d7ec7bf6709023f (diff)
[S390] cio: rename css to channel_subsystems
Rename css[] to channel_subsystems[] to avoid name clashes. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/chp.c14
-rw-r--r--drivers/s390/cio/css.c69
-rw-r--r--drivers/s390/cio/css.h2
-rw-r--r--drivers/s390/cio/device_fsm.c3
4 files changed, 49 insertions, 39 deletions
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index 920dd71e6434..8ce4ff95cc9c 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -55,7 +55,7 @@ static wait_queue_head_t cfg_wait_queue;
55/* Return channel_path struct for given chpid. */ 55/* Return channel_path struct for given chpid. */
56static inline struct channel_path *chpid_to_chp(struct chp_id chpid) 56static inline struct channel_path *chpid_to_chp(struct chp_id chpid)
57{ 57{
58 return css[chpid.cssid]->chps[chpid.id]; 58 return channel_subsystems[chpid.cssid]->chps[chpid.id];
59} 59}
60 60
61/* Set vary state for given chpid. */ 61/* Set vary state for given chpid. */
@@ -395,7 +395,7 @@ int chp_new(struct chp_id chpid)
395 /* fill in status, etc. */ 395 /* fill in status, etc. */
396 chp->chpid = chpid; 396 chp->chpid = chpid;
397 chp->state = 1; 397 chp->state = 1;
398 chp->dev.parent = &css[chpid.cssid]->device; 398 chp->dev.parent = &channel_subsystems[chpid.cssid]->device;
399 chp->dev.release = chp_release; 399 chp->dev.release = chp_release;
400 snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp%x.%02x", chpid.cssid, 400 snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp%x.%02x", chpid.cssid,
401 chpid.id); 401 chpid.id);
@@ -430,18 +430,18 @@ int chp_new(struct chp_id chpid)
430 device_unregister(&chp->dev); 430 device_unregister(&chp->dev);
431 goto out_free; 431 goto out_free;
432 } 432 }
433 mutex_lock(&css[chpid.cssid]->mutex); 433 mutex_lock(&channel_subsystems[chpid.cssid]->mutex);
434 if (css[chpid.cssid]->cm_enabled) { 434 if (channel_subsystems[chpid.cssid]->cm_enabled) {
435 ret = chp_add_cmg_attr(chp); 435 ret = chp_add_cmg_attr(chp);
436 if (ret) { 436 if (ret) {
437 sysfs_remove_group(&chp->dev.kobj, &chp_attr_group); 437 sysfs_remove_group(&chp->dev.kobj, &chp_attr_group);
438 device_unregister(&chp->dev); 438 device_unregister(&chp->dev);
439 mutex_unlock(&css[chpid.cssid]->mutex); 439 mutex_unlock(&channel_subsystems[chpid.cssid]->mutex);
440 goto out_free; 440 goto out_free;
441 } 441 }
442 } 442 }
443 css[chpid.cssid]->chps[chpid.id] = chp; 443 channel_subsystems[chpid.cssid]->chps[chpid.id] = chp;
444 mutex_unlock(&css[chpid.cssid]->mutex); 444 mutex_unlock(&channel_subsystems[chpid.cssid]->mutex);
445 return ret; 445 return ret;
446out_free: 446out_free:
447 kfree(chp); 447 kfree(chp);
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 5635e656c1a3..08f6e7b6c999 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -27,7 +27,7 @@ int css_init_done = 0;
27static int need_reprobe = 0; 27static int need_reprobe = 0;
28static int max_ssid = 0; 28static int max_ssid = 0;
29 29
30struct channel_subsystem *css[__MAX_CSSID + 1]; 30struct channel_subsystem *channel_subsystems[__MAX_CSSID + 1];
31 31
32int css_characteristics_avail = 0; 32int css_characteristics_avail = 0;
33 33
@@ -177,7 +177,7 @@ static int css_register_subchannel(struct subchannel *sch)
177 int ret; 177 int ret;
178 178
179 /* Initialize the subchannel structure */ 179 /* Initialize the subchannel structure */
180 sch->dev.parent = &css[0]->device; 180 sch->dev.parent = &channel_subsystems[0]->device;
181 sch->dev.bus = &css_bus_type; 181 sch->dev.bus = &css_bus_type;
182 sch->dev.release = &css_subchannel_release; 182 sch->dev.release = &css_subchannel_release;
183 sch->dev.groups = subch_attr_groups; 183 sch->dev.groups = subch_attr_groups;
@@ -606,27 +606,29 @@ static int __init setup_css(int nr)
606{ 606{
607 u32 tod_high; 607 u32 tod_high;
608 int ret; 608 int ret;
609 struct channel_subsystem *css;
609 610
610 memset(css[nr], 0, sizeof(struct channel_subsystem)); 611 css = channel_subsystems[nr];
611 css[nr]->pseudo_subchannel = 612 memset(css, 0, sizeof(struct channel_subsystem));
612 kzalloc(sizeof(*css[nr]->pseudo_subchannel), GFP_KERNEL); 613 css->pseudo_subchannel =
613 if (!css[nr]->pseudo_subchannel) 614 kzalloc(sizeof(*css->pseudo_subchannel), GFP_KERNEL);
615 if (!css->pseudo_subchannel)
614 return -ENOMEM; 616 return -ENOMEM;
615 css[nr]->pseudo_subchannel->dev.parent = &css[nr]->device; 617 css->pseudo_subchannel->dev.parent = &css->device;
616 css[nr]->pseudo_subchannel->dev.release = css_subchannel_release; 618 css->pseudo_subchannel->dev.release = css_subchannel_release;
617 sprintf(css[nr]->pseudo_subchannel->dev.bus_id, "defunct"); 619 sprintf(css->pseudo_subchannel->dev.bus_id, "defunct");
618 ret = cio_create_sch_lock(css[nr]->pseudo_subchannel); 620 ret = cio_create_sch_lock(css->pseudo_subchannel);
619 if (ret) { 621 if (ret) {
620 kfree(css[nr]->pseudo_subchannel); 622 kfree(css->pseudo_subchannel);
621 return ret; 623 return ret;
622 } 624 }
623 mutex_init(&css[nr]->mutex); 625 mutex_init(&css->mutex);
624 css[nr]->valid = 1; 626 css->valid = 1;
625 css[nr]->cssid = nr; 627 css->cssid = nr;
626 sprintf(css[nr]->device.bus_id, "css%x", nr); 628 sprintf(css->device.bus_id, "css%x", nr);
627 css[nr]->device.release = channel_subsystem_release; 629 css->device.release = channel_subsystem_release;
628 tod_high = (u32) (get_clock() >> 32); 630 tod_high = (u32) (get_clock() >> 32);
629 css_generate_pgid(css[nr], tod_high); 631 css_generate_pgid(css, tod_high);
630 return 0; 632 return 0;
631} 633}
632 634
@@ -670,25 +672,28 @@ init_channel_subsystem (void)
670 } 672 }
671 /* Setup css structure. */ 673 /* Setup css structure. */
672 for (i = 0; i <= __MAX_CSSID; i++) { 674 for (i = 0; i <= __MAX_CSSID; i++) {
673 css[i] = kmalloc(sizeof(struct channel_subsystem), GFP_KERNEL); 675 struct channel_subsystem *css;
674 if (!css[i]) { 676
677 css = kmalloc(sizeof(struct channel_subsystem), GFP_KERNEL);
678 if (!css) {
675 ret = -ENOMEM; 679 ret = -ENOMEM;
676 goto out_unregister; 680 goto out_unregister;
677 } 681 }
682 channel_subsystems[i] = css;
678 ret = setup_css(i); 683 ret = setup_css(i);
679 if (ret) 684 if (ret)
680 goto out_free; 685 goto out_free;
681 ret = device_register(&css[i]->device); 686 ret = device_register(&css->device);
682 if (ret) 687 if (ret)
683 goto out_free_all; 688 goto out_free_all;
684 if (css_characteristics_avail && 689 if (css_characteristics_avail &&
685 css_chsc_characteristics.secm) { 690 css_chsc_characteristics.secm) {
686 ret = device_create_file(&css[i]->device, 691 ret = device_create_file(&css->device,
687 &dev_attr_cm_enable); 692 &dev_attr_cm_enable);
688 if (ret) 693 if (ret)
689 goto out_device; 694 goto out_device;
690 } 695 }
691 ret = device_register(&css[i]->pseudo_subchannel->dev); 696 ret = device_register(&css->pseudo_subchannel->dev);
692 if (ret) 697 if (ret)
693 goto out_file; 698 goto out_file;
694 } 699 }
@@ -699,22 +704,26 @@ init_channel_subsystem (void)
699 for_each_subchannel(__init_channel_subsystem, NULL); 704 for_each_subchannel(__init_channel_subsystem, NULL);
700 return 0; 705 return 0;
701out_file: 706out_file:
702 device_remove_file(&css[i]->device, &dev_attr_cm_enable); 707 device_remove_file(&channel_subsystems[i]->device,
708 &dev_attr_cm_enable);
703out_device: 709out_device:
704 device_unregister(&css[i]->device); 710 device_unregister(&channel_subsystems[i]->device);
705out_free_all: 711out_free_all:
706 kfree(css[i]->pseudo_subchannel->lock); 712 kfree(channel_subsystems[i]->pseudo_subchannel->lock);
707 kfree(css[i]->pseudo_subchannel); 713 kfree(channel_subsystems[i]->pseudo_subchannel);
708out_free: 714out_free:
709 kfree(css[i]); 715 kfree(channel_subsystems[i]);
710out_unregister: 716out_unregister:
711 while (i > 0) { 717 while (i > 0) {
718 struct channel_subsystem *css;
719
712 i--; 720 i--;
713 device_unregister(&css[i]->pseudo_subchannel->dev); 721 css = channel_subsystems[i];
722 device_unregister(&css->pseudo_subchannel->dev);
714 if (css_characteristics_avail && css_chsc_characteristics.secm) 723 if (css_characteristics_avail && css_chsc_characteristics.secm)
715 device_remove_file(&css[i]->device, 724 device_remove_file(&css->device,
716 &dev_attr_cm_enable); 725 &dev_attr_cm_enable);
717 device_unregister(&css[i]->device); 726 device_unregister(&css->device);
718 } 727 }
719out_bus: 728out_bus:
720 bus_unregister(&css_bus_type); 729 bus_unregister(&css_bus_type);
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h
index 5d65e83ca66e..f290c5c0f27b 100644
--- a/drivers/s390/cio/css.h
+++ b/drivers/s390/cio/css.h
@@ -167,7 +167,7 @@ struct channel_subsystem {
167#define to_css(dev) container_of(dev, struct channel_subsystem, device) 167#define to_css(dev) container_of(dev, struct channel_subsystem, device)
168 168
169extern struct bus_type css_bus_type; 169extern struct bus_type css_bus_type;
170extern struct channel_subsystem *css[]; 170extern struct channel_subsystem *channel_subsystems[];
171 171
172/* Some helper functions for disconnected state. */ 172/* Some helper functions for disconnected state. */
173int device_is_disconnected(struct subchannel *); 173int device_is_disconnected(struct subchannel *);
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 8633dc537695..f772ef0a4f22 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -446,7 +446,8 @@ static void __ccw_device_get_common_pgid(struct ccw_device *cdev)
446 if (cdev->private->pgid[last].inf.ps.state1 == 446 if (cdev->private->pgid[last].inf.ps.state1 ==
447 SNID_STATE1_RESET) 447 SNID_STATE1_RESET)
448 /* No previous pgid found */ 448 /* No previous pgid found */
449 memcpy(&cdev->private->pgid[0], &css[0]->global_pgid, 449 memcpy(&cdev->private->pgid[0],
450 &channel_subsystems[0]->global_pgid,
450 sizeof(struct pgid)); 451 sizeof(struct pgid));
451 else 452 else
452 /* Use existing pgid */ 453 /* Use existing pgid */