mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-28 15:13:55 +08:00
e018ba1fce
- Remove all CVS generated information like e.g. revision IDs from drivers/s390 and include/asm-s390 (none present in arch/s390). - Add newline at end of arch/s390/lib/Makefile to avoid diff message. Acked-by: Andreas Herrmann <aherrman@de.ibm.com> Acked-by: Frank Pavlic <pavlic@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
53 lines
1.0 KiB
C
53 lines
1.0 KiB
C
/*
|
|
* drivers/s390/s390_rdev.c
|
|
* s390 root device
|
|
*
|
|
* Copyright (C) 2002, 2005 IBM Deutschland Entwicklung GmbH,
|
|
* IBM Corporation
|
|
* Author(s): Cornelia Huck (cornelia.huck@de.ibm.com)
|
|
* Carsten Otte (cotte@de.ibm.com)
|
|
*/
|
|
|
|
#include <linux/slab.h>
|
|
#include <linux/err.h>
|
|
#include <linux/device.h>
|
|
#include <asm/s390_rdev.h>
|
|
|
|
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);
|
|
}
|
|
|
|
EXPORT_SYMBOL(s390_root_dev_register);
|
|
EXPORT_SYMBOL(s390_root_dev_unregister);
|