s390/cio: get rid of static console subchannel

Remove the static console subchannel (and friends) and use dynamic
allocation for these structures. With this change the console
subchanel is treated (mostly) like any other subchannel and we can
remove some special cases.

Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Sebastian Ott
2013-04-13 13:01:50 +02:00
committed by Martin Schwidefsky
parent c135ad1caf
commit 863fc84927
5 changed files with 56 additions and 108 deletions

View File

@@ -139,19 +139,15 @@ static void css_sch_todo(struct work_struct *work);
static void css_subchannel_release(struct device *dev)
{
struct subchannel *sch;
struct subchannel *sch = to_subchannel(dev);
sch = to_subchannel(dev);
if (!cio_is_console(sch->schid)) {
/* Reset intparm to zeroes. */
sch->config.intparm = 0;
cio_commit_config(sch);
kfree(sch->lock);
kfree(sch);
}
sch->config.intparm = 0;
cio_commit_config(sch);
kfree(sch->lock);
kfree(sch);
}
static struct subchannel *css_alloc_subchannel(struct subchannel_id schid)
struct subchannel *css_alloc_subchannel(struct subchannel_id schid)
{
struct subchannel *sch;
int ret;
@@ -326,10 +322,9 @@ int css_probe_device(struct subchannel_id schid)
return PTR_ERR(sch);
}
ret = css_register_subchannel(sch);
if (ret) {
if (!cio_is_console(schid))
put_device(&sch->dev);
}
if (ret)
put_device(&sch->dev);
return ret;
}