Commit cfb1b555 authored by Carsten Otte's avatar Carsten Otte Committed by Linus Torvalds
Browse files

[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: default avatarCarsten Otte <cotte@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6810a2bc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
# Makefile for the S/390 specific device drivers
#

obj-y += s390mach.o sysinfo.o
obj-y += s390mach.o sysinfo.o s390_rdev.o
obj-y += cio/ block/ char/ crypto/ net/ scsi/

drivers-y += drivers/s390/built-in.o
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
#include <asm/io.h>
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <asm/ccwdev.h> 	// for s390_root_dev_(un)register()
#include <asm/s390_rdev.h>

//#define DCSSBLK_DEBUG		/* Debug messages on/off */
#define DCSSBLK_NAME "dcssblk"
+0 −41
Original line number Diff line number Diff line
@@ -481,45 +481,6 @@ struct bus_type css_bus_type = {

subsys_initcall(init_channel_subsystem);

/*
 * Register root devices for some drivers. The release function must not be
 * in the device drivers, so we do it here.
 */
static void
s390_root_dev_release(struct device *dev)
{
	kfree(dev);
}

struct device *
s390_root_dev_register(const char *name)
{
	struct device *dev;
	int ret;

	if (!strlen(name))
		return ERR_PTR(-EINVAL);
	dev = kmalloc(sizeof(struct device), GFP_KERNEL);
	if (!dev)
		return ERR_PTR(-ENOMEM);
	memset(dev, 0, sizeof(struct device));
	strncpy(dev->bus_id, name, min(strlen(name), (size_t)BUS_ID_SIZE));
	dev->release = s390_root_dev_release;
	ret = device_register(dev);
	if (ret) {
		kfree(dev);
		return ERR_PTR(ret);
	}
	return dev;
}

void
s390_root_dev_unregister(struct device *dev)
{
	if (dev)
		device_unregister(dev);
}

int
css_enqueue_subchannel_slow(unsigned long schid)
{
@@ -564,6 +525,4 @@ css_slow_subchannels_exist(void)

MODULE_LICENSE("GPL");
EXPORT_SYMBOL(css_bus_type);
EXPORT_SYMBOL(s390_root_dev_register);
EXPORT_SYMBOL(s390_root_dev_unregister);
EXPORT_SYMBOL_GPL(css_characteristics_avail);
+2 −1
Original line number Diff line number Diff line
/*
 * $Id: cu3088.c,v 1.35 2005/03/30 19:28:52 richtera Exp $
 * $Id: cu3088.c,v 1.36 2005/10/25 14:37:17 cohuck Exp $
 *
 * CTC / LCS ccw_device driver
 *
@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/err.h>

#include <asm/s390_rdev.h>
#include <asm/ccwdev.h>
#include <asm/ccwgroup.h>

+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@
#include <asm/s390_ext.h>
#include <asm/ebcdic.h>
#include <asm/smp.h>
#include <asm/ccwdev.h> //for root device stuff
#include <asm/s390_rdev.h>

/* FLAGS:
 * All flags are defined in the field IPFLAGS1 of each function
Loading