aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/css.c
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/cio/css.c
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/cio/css.c')
-rw-r--r--drivers/s390/cio/css.c69
1 files changed, 39 insertions, 30 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 5635e656c1a..08f6e7b6c99 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);