Commit 7c9f4e3a authored by Cornelia Huck's avatar Cornelia Huck Committed by Martin Schwidefsky

[S390] cio: rename css to channel_subsystems

Rename css[] to channel_subsystems[] to avoid name clashes.
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent 782e3b3b
...@@ -55,7 +55,7 @@ static wait_queue_head_t cfg_wait_queue; ...@@ -55,7 +55,7 @@ static wait_queue_head_t cfg_wait_queue;
/* Return channel_path struct for given chpid. */ /* Return channel_path struct for given chpid. */
static inline struct channel_path *chpid_to_chp(struct chp_id chpid) static inline struct channel_path *chpid_to_chp(struct chp_id chpid)
{ {
return css[chpid.cssid]->chps[chpid.id]; return channel_subsystems[chpid.cssid]->chps[chpid.id];
} }
/* Set vary state for given chpid. */ /* Set vary state for given chpid. */
...@@ -395,7 +395,7 @@ int chp_new(struct chp_id chpid) ...@@ -395,7 +395,7 @@ int chp_new(struct chp_id chpid)
/* fill in status, etc. */ /* fill in status, etc. */
chp->chpid = chpid; chp->chpid = chpid;
chp->state = 1; chp->state = 1;
chp->dev.parent = &css[chpid.cssid]->device; chp->dev.parent = &channel_subsystems[chpid.cssid]->device;
chp->dev.release = chp_release; chp->dev.release = chp_release;
snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp%x.%02x", chpid.cssid, snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp%x.%02x", chpid.cssid,
chpid.id); chpid.id);
...@@ -430,18 +430,18 @@ int chp_new(struct chp_id chpid) ...@@ -430,18 +430,18 @@ int chp_new(struct chp_id chpid)
device_unregister(&chp->dev); device_unregister(&chp->dev);
goto out_free; goto out_free;
} }
mutex_lock(&css[chpid.cssid]->mutex); mutex_lock(&channel_subsystems[chpid.cssid]->mutex);
if (css[chpid.cssid]->cm_enabled) { if (channel_subsystems[chpid.cssid]->cm_enabled) {
ret = chp_add_cmg_attr(chp); ret = chp_add_cmg_attr(chp);
if (ret) { if (ret) {
sysfs_remove_group(&chp->dev.kobj, &chp_attr_group); sysfs_remove_group(&chp->dev.kobj, &chp_attr_group);
device_unregister(&chp->dev); device_unregister(&chp->dev);
mutex_unlock(&css[chpid.cssid]->mutex); mutex_unlock(&channel_subsystems[chpid.cssid]->mutex);
goto out_free; goto out_free;
} }
} }
css[chpid.cssid]->chps[chpid.id] = chp; channel_subsystems[chpid.cssid]->chps[chpid.id] = chp;
mutex_unlock(&css[chpid.cssid]->mutex); mutex_unlock(&channel_subsystems[chpid.cssid]->mutex);
return ret; return ret;
out_free: out_free:
kfree(chp); kfree(chp);
......
...@@ -27,7 +27,7 @@ int css_init_done = 0; ...@@ -27,7 +27,7 @@ int css_init_done = 0;
static int need_reprobe = 0; static int need_reprobe = 0;
static int max_ssid = 0; static int max_ssid = 0;
struct channel_subsystem *css[__MAX_CSSID + 1]; struct channel_subsystem *channel_subsystems[__MAX_CSSID + 1];
int css_characteristics_avail = 0; int css_characteristics_avail = 0;
...@@ -177,7 +177,7 @@ static int css_register_subchannel(struct subchannel *sch) ...@@ -177,7 +177,7 @@ static int css_register_subchannel(struct subchannel *sch)
int ret; int ret;
/* Initialize the subchannel structure */ /* Initialize the subchannel structure */
sch->dev.parent = &css[0]->device; sch->dev.parent = &channel_subsystems[0]->device;
sch->dev.bus = &css_bus_type; sch->dev.bus = &css_bus_type;
sch->dev.release = &css_subchannel_release; sch->dev.release = &css_subchannel_release;
sch->dev.groups = subch_attr_groups; sch->dev.groups = subch_attr_groups;
...@@ -606,27 +606,29 @@ static int __init setup_css(int nr) ...@@ -606,27 +606,29 @@ static int __init setup_css(int nr)
{ {
u32 tod_high; u32 tod_high;
int ret; int ret;
struct channel_subsystem *css;
memset(css[nr], 0, sizeof(struct channel_subsystem)); css = channel_subsystems[nr];
css[nr]->pseudo_subchannel = memset(css, 0, sizeof(struct channel_subsystem));
kzalloc(sizeof(*css[nr]->pseudo_subchannel), GFP_KERNEL); css->pseudo_subchannel =
if (!css[nr]->pseudo_subchannel) kzalloc(sizeof(*css->pseudo_subchannel), GFP_KERNEL);
if (!css->pseudo_subchannel)
return -ENOMEM; return -ENOMEM;
css[nr]->pseudo_subchannel->dev.parent = &css[nr]->device; css->pseudo_subchannel->dev.parent = &css->device;
css[nr]->pseudo_subchannel->dev.release = css_subchannel_release; css->pseudo_subchannel->dev.release = css_subchannel_release;
sprintf(css[nr]->pseudo_subchannel->dev.bus_id, "defunct"); sprintf(css->pseudo_subchannel->dev.bus_id, "defunct");
ret = cio_create_sch_lock(css[nr]->pseudo_subchannel); ret = cio_create_sch_lock(css->pseudo_subchannel);
if (ret) { if (ret) {
kfree(css[nr]->pseudo_subchannel); kfree(css->pseudo_subchannel);
return ret; return ret;
} }
mutex_init(&css[nr]->mutex); mutex_init(&css->mutex);
css[nr]->valid = 1; css->valid = 1;
css[nr]->cssid = nr; css->cssid = nr;
sprintf(css[nr]->device.bus_id, "css%x", nr); sprintf(css->device.bus_id, "css%x", nr);
css[nr]->device.release = channel_subsystem_release; css->device.release = channel_subsystem_release;
tod_high = (u32) (get_clock() >> 32); tod_high = (u32) (get_clock() >> 32);
css_generate_pgid(css[nr], tod_high); css_generate_pgid(css, tod_high);
return 0; return 0;
} }
...@@ -670,25 +672,28 @@ init_channel_subsystem (void) ...@@ -670,25 +672,28 @@ init_channel_subsystem (void)
} }
/* Setup css structure. */ /* Setup css structure. */
for (i = 0; i <= __MAX_CSSID; i++) { for (i = 0; i <= __MAX_CSSID; i++) {
css[i] = kmalloc(sizeof(struct channel_subsystem), GFP_KERNEL); struct channel_subsystem *css;
if (!css[i]) {
css = kmalloc(sizeof(struct channel_subsystem), GFP_KERNEL);
if (!css) {
ret = -ENOMEM; ret = -ENOMEM;
goto out_unregister; goto out_unregister;
} }
channel_subsystems[i] = css;
ret = setup_css(i); ret = setup_css(i);
if (ret) if (ret)
goto out_free; goto out_free;
ret = device_register(&css[i]->device); ret = device_register(&css->device);
if (ret) if (ret)
goto out_free_all; goto out_free_all;
if (css_characteristics_avail && if (css_characteristics_avail &&
css_chsc_characteristics.secm) { css_chsc_characteristics.secm) {
ret = device_create_file(&css[i]->device, ret = device_create_file(&css->device,
&dev_attr_cm_enable); &dev_attr_cm_enable);
if (ret) if (ret)
goto out_device; goto out_device;
} }
ret = device_register(&css[i]->pseudo_subchannel->dev); ret = device_register(&css->pseudo_subchannel->dev);
if (ret) if (ret)
goto out_file; goto out_file;
} }
...@@ -699,22 +704,26 @@ init_channel_subsystem (void) ...@@ -699,22 +704,26 @@ init_channel_subsystem (void)
for_each_subchannel(__init_channel_subsystem, NULL); for_each_subchannel(__init_channel_subsystem, NULL);
return 0; return 0;
out_file: out_file:
device_remove_file(&css[i]->device, &dev_attr_cm_enable); device_remove_file(&channel_subsystems[i]->device,
&dev_attr_cm_enable);
out_device: out_device:
device_unregister(&css[i]->device); device_unregister(&channel_subsystems[i]->device);
out_free_all: out_free_all:
kfree(css[i]->pseudo_subchannel->lock); kfree(channel_subsystems[i]->pseudo_subchannel->lock);
kfree(css[i]->pseudo_subchannel); kfree(channel_subsystems[i]->pseudo_subchannel);
out_free: out_free:
kfree(css[i]); kfree(channel_subsystems[i]);
out_unregister: out_unregister:
while (i > 0) { while (i > 0) {
struct channel_subsystem *css;
i--; i--;
device_unregister(&css[i]->pseudo_subchannel->dev); css = channel_subsystems[i];
device_unregister(&css->pseudo_subchannel->dev);
if (css_characteristics_avail && css_chsc_characteristics.secm) if (css_characteristics_avail && css_chsc_characteristics.secm)
device_remove_file(&css[i]->device, device_remove_file(&css->device,
&dev_attr_cm_enable); &dev_attr_cm_enable);
device_unregister(&css[i]->device); device_unregister(&css->device);
} }
out_bus: out_bus:
bus_unregister(&css_bus_type); bus_unregister(&css_bus_type);
......
...@@ -167,7 +167,7 @@ struct channel_subsystem { ...@@ -167,7 +167,7 @@ struct channel_subsystem {
#define to_css(dev) container_of(dev, struct channel_subsystem, device) #define to_css(dev) container_of(dev, struct channel_subsystem, device)
extern struct bus_type css_bus_type; extern struct bus_type css_bus_type;
extern struct channel_subsystem *css[]; extern struct channel_subsystem *channel_subsystems[];
/* Some helper functions for disconnected state. */ /* Some helper functions for disconnected state. */
int device_is_disconnected(struct subchannel *); int device_is_disconnected(struct subchannel *);
......
...@@ -446,7 +446,8 @@ static void __ccw_device_get_common_pgid(struct ccw_device *cdev) ...@@ -446,7 +446,8 @@ static void __ccw_device_get_common_pgid(struct ccw_device *cdev)
if (cdev->private->pgid[last].inf.ps.state1 == if (cdev->private->pgid[last].inf.ps.state1 ==
SNID_STATE1_RESET) SNID_STATE1_RESET)
/* No previous pgid found */ /* No previous pgid found */
memcpy(&cdev->private->pgid[0], &css[0]->global_pgid, memcpy(&cdev->private->pgid[0],
&channel_subsystems[0]->global_pgid,
sizeof(struct pgid)); sizeof(struct pgid));
else else
/* Use existing pgid */ /* Use existing pgid */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment