aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio
diff options
context:
space:
mode:
authorCarsten Otte <cotte@de.ibm.com>2006-01-06 03:19:14 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:49 -0500
commitcfb1b55595a0dfd87b5849e8d0216c029f34445f (patch)
tree86d73bda5e9c82e70a4bdbacfac6be5644c8a987 /drivers/s390/cio
parent6810a2bce3aa6573faa9920487274f166fe95c6e (diff)
[PATCH] s390: move s390_root_dev_* out of the cio layer
Extract the s390_root_dev_* functions from the common I/O layer as they are also used by non-ccw device drivers. Signed-off-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r--drivers/s390/cio/css.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 555119cacc27..7e4d57b4266f 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -481,45 +481,6 @@ struct bus_type css_bus_type = {
481 481
482subsys_initcall(init_channel_subsystem); 482subsys_initcall(init_channel_subsystem);
483 483
484/*
485 * Register root devices for some drivers. The release function must not be
486 * in the device drivers, so we do it here.
487 */
488static void
489s390_root_dev_release(struct device *dev)
490{
491 kfree(dev);
492}
493
494struct device *
495s390_root_dev_register(const char *name)
496{
497 struct device *dev;
498 int ret;
499
500 if (!strlen(name))
501 return ERR_PTR(-EINVAL);
502 dev = kmalloc(sizeof(struct device), GFP_KERNEL);
503 if (!dev)
504 return ERR_PTR(-ENOMEM);
505 memset(dev, 0, sizeof(struct device));
506 strncpy(dev->bus_id, name, min(strlen(name), (size_t)BUS_ID_SIZE));
507 dev->release = s390_root_dev_release;
508 ret = device_register(dev);
509 if (ret) {
510 kfree(dev);
511 return ERR_PTR(ret);
512 }
513 return dev;
514}
515
516void
517s390_root_dev_unregister(struct device *dev)
518{
519 if (dev)
520 device_unregister(dev);
521}
522
523int 484int
524css_enqueue_subchannel_slow(unsigned long schid) 485css_enqueue_subchannel_slow(unsigned long schid)
525{ 486{
@@ -564,6 +525,4 @@ css_slow_subchannels_exist(void)
564 525
565MODULE_LICENSE("GPL"); 526MODULE_LICENSE("GPL");
566EXPORT_SYMBOL(css_bus_type); 527EXPORT_SYMBOL(css_bus_type);
567EXPORT_SYMBOL(s390_root_dev_register);
568EXPORT_SYMBOL(s390_root_dev_unregister);
569EXPORT_SYMBOL_GPL(css_characteristics_avail); 528EXPORT_SYMBOL_GPL(css_characteristics_avail);