summaryrefslogtreecommitdiff
path: root/udev_add.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-02-21 13:45:04 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:36:13 -0700
commit5ef42682053f57fc031d420f0a2ae3e204421b8d (patch)
tree7ddd231fd445f1dfc10f2f22e1dae7b551a0ced9 /udev_add.c
parent7e720bd4ad8257d81d273d98294ebbcc03ade9ba (diff)
[PATCH] switch device type to enum
Diffstat (limited to 'udev_add.c')
-rw-r--r--udev_add.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/udev_add.c b/udev_add.c
index 66264f06e0..eeab1ca174 100644
--- a/udev_add.c
+++ b/udev_add.c
@@ -70,16 +70,12 @@ int udev_make_node(struct udevice *udev, const char *file, dev_t devt, mode_t mo
create:
switch (udev->type) {
- case 'b':
+ case BLOCK:
mode |= S_IFBLK;
break;
- case 'c':
- case 'u':
+ case CLASS:
mode |= S_IFCHR;
break;
- case 'p':
- mode |= S_IFIFO;
- break;
default:
dbg("unknown node type %c\n", udev->type);
return -EINVAL;
@@ -277,7 +273,7 @@ int udev_add_device(struct udevice *udev, struct sysfs_class_device *class_dev)
char *pos;
int retval = 0;
- if (udev->type == 'b' || udev->type == 'c') {
+ if (udev->type == BLOCK || udev->type == CLASS) {
udev->devt = get_devt(class_dev);
if (!udev->devt) {
dbg("no dev-file found, do nothing");
@@ -292,7 +288,7 @@ int udev_add_device(struct udevice *udev, struct sysfs_class_device *class_dev)
selinux_init();
- if (udev->type == 'b' || udev->type == 'c') {
+ if (udev->type == BLOCK || udev->type == CLASS) {
retval = create_node(udev, class_dev);
if (retval != 0)
goto exit;
@@ -305,7 +301,7 @@ int udev_add_device(struct udevice *udev, struct sysfs_class_device *class_dev)
snprintf(udev->devname, NAME_SIZE, "%s/%s", udev_root, udev->name);
udev->devname[NAME_SIZE-1] = '\0';
- } else if (udev->type == 'n') {
+ } else if (udev->type == NET) {
/* look if we want to change the name of the netif */
if (strcmp(udev->name, udev->kernel_name) != 0) {
retval = rename_net_if(udev);