summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device.c
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2013-04-13 13:01:50 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-04-17 14:07:32 +0200
commit863fc8492734822b95671780db803cd9a4b7d923 (patch)
treebadeeb42bc2f1d047849882aecd37fffef91ca20 /drivers/s390/cio/device.c
parentc135ad1caffe2b35d6316758a605a2b63ca22bb3 (diff)
downloadlinux-863fc8492734822b95671780db803cd9a4b7d923.tar.gz
linux-863fc8492734822b95671780db803cd9a4b7d923.tar.bz2
linux-863fc8492734822b95671780db803cd9a4b7d923.zip
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>
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r--drivers/s390/cio/device.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 6ac0066d3158..25d04b7b5109 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -1585,22 +1585,11 @@ static struct ccw_device console_cdev;
static struct ccw_device_private console_private;
static int console_cdev_in_use;
-static DEFINE_SPINLOCK(ccw_console_lock);
-
-spinlock_t * cio_get_console_lock(void)
-{
- return &ccw_console_lock;
-}
-
static int ccw_device_console_enable(struct ccw_device *cdev,
struct subchannel *sch)
{
- struct io_subchannel_private *io_priv = cio_get_console_priv();
int rc;
- /* Attach subchannel private data. */
- memset(io_priv, 0, sizeof(*io_priv));
- set_io_private(sch, io_priv);
io_subchannel_init_fields(sch);
rc = cio_commit_config(sch);
if (rc)
@@ -1633,6 +1622,7 @@ out_unlock:
struct ccw_device *
ccw_device_probe_console(void)
{
+ struct io_subchannel_private *io_priv;
struct subchannel *sch;
int ret;
@@ -1648,10 +1638,20 @@ ccw_device_probe_console(void)
console_cdev.private = &console_private;
console_private.cdev = &console_cdev;
console_private.int_class = IRQIO_CIO;
+
+ io_priv = kzalloc(sizeof(*io_priv), GFP_KERNEL | GFP_DMA);
+ if (!io_priv) {
+ put_device(&sch->dev);
+ return ERR_PTR(-ENOMEM);
+ }
+ set_io_private(sch, io_priv);
+
ret = ccw_device_console_enable(&console_cdev, sch);
if (ret) {
- cio_release_console();
console_cdev_in_use = 0;
+ set_io_private(sch, NULL);
+ put_device(&sch->dev);
+ kfree(io_priv);
return ERR_PTR(ret);
}
console_cdev.online = 1;