diff options
Diffstat (limited to 'arch/um/drivers/ubd_kern.c')
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 0a868118cf06..d42f826a8ab9 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -17,7 +17,6 @@ | |||
17 | * James McMechan | 17 | * James McMechan |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define MAJOR_NR UBD_MAJOR | ||
21 | #define UBD_SHIFT 4 | 20 | #define UBD_SHIFT 4 |
22 | 21 | ||
23 | #include "linux/kernel.h" | 22 | #include "linux/kernel.h" |
@@ -115,7 +114,7 @@ static struct block_device_operations ubd_blops = { | |||
115 | }; | 114 | }; |
116 | 115 | ||
117 | /* Protected by ubd_lock */ | 116 | /* Protected by ubd_lock */ |
118 | static int fake_major = MAJOR_NR; | 117 | static int fake_major = UBD_MAJOR; |
119 | static struct gendisk *ubd_gendisk[MAX_DEV]; | 118 | static struct gendisk *ubd_gendisk[MAX_DEV]; |
120 | static struct gendisk *fake_gendisk[MAX_DEV]; | 119 | static struct gendisk *fake_gendisk[MAX_DEV]; |
121 | 120 | ||
@@ -299,7 +298,7 @@ static int ubd_setup_common(char *str, int *index_out, char **error_out) | |||
299 | } | 298 | } |
300 | 299 | ||
301 | mutex_lock(&ubd_lock); | 300 | mutex_lock(&ubd_lock); |
302 | if(fake_major != MAJOR_NR){ | 301 | if (fake_major != UBD_MAJOR) { |
303 | *error_out = "Can't assign a fake major twice"; | 302 | *error_out = "Can't assign a fake major twice"; |
304 | goto out1; | 303 | goto out1; |
305 | } | 304 | } |
@@ -818,13 +817,13 @@ static int ubd_disk_register(int major, u64 size, int unit, | |||
818 | disk->first_minor = unit << UBD_SHIFT; | 817 | disk->first_minor = unit << UBD_SHIFT; |
819 | disk->fops = &ubd_blops; | 818 | disk->fops = &ubd_blops; |
820 | set_capacity(disk, size / 512); | 819 | set_capacity(disk, size / 512); |
821 | if(major == MAJOR_NR) | 820 | if (major == UBD_MAJOR) |
822 | sprintf(disk->disk_name, "ubd%c", 'a' + unit); | 821 | sprintf(disk->disk_name, "ubd%c", 'a' + unit); |
823 | else | 822 | else |
824 | sprintf(disk->disk_name, "ubd_fake%d", unit); | 823 | sprintf(disk->disk_name, "ubd_fake%d", unit); |
825 | 824 | ||
826 | /* sysfs register (not for ide fake devices) */ | 825 | /* sysfs register (not for ide fake devices) */ |
827 | if (major == MAJOR_NR) { | 826 | if (major == UBD_MAJOR) { |
828 | ubd_devs[unit].pdev.id = unit; | 827 | ubd_devs[unit].pdev.id = unit; |
829 | ubd_devs[unit].pdev.name = DRIVER_NAME; | 828 | ubd_devs[unit].pdev.name = DRIVER_NAME; |
830 | ubd_devs[unit].pdev.dev.release = ubd_device_release; | 829 | ubd_devs[unit].pdev.dev.release = ubd_device_release; |
@@ -871,13 +870,13 @@ static int ubd_add(int n, char **error_out) | |||
871 | ubd_dev->queue->queuedata = ubd_dev; | 870 | ubd_dev->queue->queuedata = ubd_dev; |
872 | 871 | ||
873 | blk_queue_max_hw_segments(ubd_dev->queue, MAX_SG); | 872 | blk_queue_max_hw_segments(ubd_dev->queue, MAX_SG); |
874 | err = ubd_disk_register(MAJOR_NR, ubd_dev->size, n, &ubd_gendisk[n]); | 873 | err = ubd_disk_register(UBD_MAJOR, ubd_dev->size, n, &ubd_gendisk[n]); |
875 | if(err){ | 874 | if(err){ |
876 | *error_out = "Failed to register device"; | 875 | *error_out = "Failed to register device"; |
877 | goto out_cleanup; | 876 | goto out_cleanup; |
878 | } | 877 | } |
879 | 878 | ||
880 | if(fake_major != MAJOR_NR) | 879 | if (fake_major != UBD_MAJOR) |
881 | ubd_disk_register(fake_major, ubd_dev->size, n, | 880 | ubd_disk_register(fake_major, ubd_dev->size, n, |
882 | &fake_gendisk[n]); | 881 | &fake_gendisk[n]); |
883 | 882 | ||
@@ -1059,10 +1058,10 @@ static int __init ubd_init(void) | |||
1059 | char *error; | 1058 | char *error; |
1060 | int i, err; | 1059 | int i, err; |
1061 | 1060 | ||
1062 | if (register_blkdev(MAJOR_NR, "ubd")) | 1061 | if (register_blkdev(UBD_MAJOR, "ubd")) |
1063 | return -1; | 1062 | return -1; |
1064 | 1063 | ||
1065 | if (fake_major != MAJOR_NR) { | 1064 | if (fake_major != UBD_MAJOR) { |
1066 | char name[sizeof("ubd_nnn\0")]; | 1065 | char name[sizeof("ubd_nnn\0")]; |
1067 | 1066 | ||
1068 | snprintf(name, sizeof(name), "ubd_%d", fake_major); | 1067 | snprintf(name, sizeof(name), "ubd_%d", fake_major); |