s390/css: introduce cio_register_early_subchannels
Use cio_register_early_subchannels to register early subchannels
which are already in use. Call this function before we do the
actual subchannel scanning loop. This helps us to get rid of some
more special cases regarding the console subchannel.
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>
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index ab99500..3ab99d8 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -749,9 +749,16 @@
return schid_equal(&schid, &console_sch->schid);
}
-struct subchannel *cio_get_console_subchannel(void)
+void cio_register_early_subchannels(void)
{
- return console_sch;
+ int ret;
+
+ if (!console_sch)
+ return;
+
+ ret = css_register_subchannel(console_sch);
+ if (ret)
+ put_device(&console_sch->dev);
}
#endif /* CONFIG_CCW_CONSOLE */