diff options
author | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
commit | bac30d1a78d0f11c613968fc8b351a91ed465386 (patch) | |
tree | e52f3c876522a2f6047a6ec1c27df2e8a79486b8 /drivers/block | |
parent | e8222502ee6157e2713da9e0792c21f4ad458d50 (diff) | |
parent | ca9ba4471c1203bb6e759b76e83167fec54fe590 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/DAC960.c | 24 | ||||
-rw-r--r-- | drivers/block/Kconfig | 3 | ||||
-rw-r--r-- | drivers/block/acsi_slm.c | 2 | ||||
-rw-r--r-- | drivers/block/cciss.c | 12 | ||||
-rw-r--r-- | drivers/block/cciss_scsi.c | 3 | ||||
-rw-r--r-- | drivers/block/floppy.c | 9 | ||||
-rw-r--r-- | drivers/block/paride/bpck6.c | 3 | ||||
-rw-r--r-- | drivers/block/paride/pd.c | 3 | ||||
-rw-r--r-- | drivers/block/paride/pg.c | 8 | ||||
-rw-r--r-- | drivers/block/paride/pt.c | 8 | ||||
-rw-r--r-- | drivers/block/umem.c | 5 |
11 files changed, 39 insertions, 41 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 9bdea2a5cf0e..45bcda544880 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/timer.h> | 41 | #include <linux/timer.h> |
42 | #include <linux/pci.h> | 42 | #include <linux/pci.h> |
43 | #include <linux/init.h> | 43 | #include <linux/init.h> |
44 | #include <linux/jiffies.h> | ||
44 | #include <linux/random.h> | 45 | #include <linux/random.h> |
45 | #include <asm/io.h> | 46 | #include <asm/io.h> |
46 | #include <asm/uaccess.h> | 47 | #include <asm/uaccess.h> |
@@ -311,11 +312,10 @@ static boolean DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller) | |||
311 | CommandsRemaining = CommandAllocationGroupSize; | 312 | CommandsRemaining = CommandAllocationGroupSize; |
312 | CommandGroupByteCount = | 313 | CommandGroupByteCount = |
313 | CommandsRemaining * CommandAllocationLength; | 314 | CommandsRemaining * CommandAllocationLength; |
314 | AllocationPointer = kmalloc(CommandGroupByteCount, GFP_ATOMIC); | 315 | AllocationPointer = kzalloc(CommandGroupByteCount, GFP_ATOMIC); |
315 | if (AllocationPointer == NULL) | 316 | if (AllocationPointer == NULL) |
316 | return DAC960_Failure(Controller, | 317 | return DAC960_Failure(Controller, |
317 | "AUXILIARY STRUCTURE CREATION"); | 318 | "AUXILIARY STRUCTURE CREATION"); |
318 | memset(AllocationPointer, 0, CommandGroupByteCount); | ||
319 | } | 319 | } |
320 | Command = (DAC960_Command_T *) AllocationPointer; | 320 | Command = (DAC960_Command_T *) AllocationPointer; |
321 | AllocationPointer += CommandAllocationLength; | 321 | AllocationPointer += CommandAllocationLength; |
@@ -2709,14 +2709,12 @@ DAC960_DetectController(struct pci_dev *PCI_Device, | |||
2709 | void __iomem *BaseAddress; | 2709 | void __iomem *BaseAddress; |
2710 | int i; | 2710 | int i; |
2711 | 2711 | ||
2712 | Controller = (DAC960_Controller_T *) | 2712 | Controller = kzalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC); |
2713 | kmalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC); | ||
2714 | if (Controller == NULL) { | 2713 | if (Controller == NULL) { |
2715 | DAC960_Error("Unable to allocate Controller structure for " | 2714 | DAC960_Error("Unable to allocate Controller structure for " |
2716 | "Controller at\n", NULL); | 2715 | "Controller at\n", NULL); |
2717 | return NULL; | 2716 | return NULL; |
2718 | } | 2717 | } |
2719 | memset(Controller, 0, sizeof(DAC960_Controller_T)); | ||
2720 | Controller->ControllerNumber = DAC960_ControllerCount; | 2718 | Controller->ControllerNumber = DAC960_ControllerCount; |
2721 | DAC960_Controllers[DAC960_ControllerCount++] = Controller; | 2719 | DAC960_Controllers[DAC960_ControllerCount++] = Controller; |
2722 | Controller->Bus = PCI_Device->bus->number; | 2720 | Controller->Bus = PCI_Device->bus->number; |
@@ -3657,8 +3655,8 @@ static void DAC960_V1_ProcessCompletedCommand(DAC960_Command_T *Command) | |||
3657 | (NewEnquiry->EventLogSequenceNumber != | 3655 | (NewEnquiry->EventLogSequenceNumber != |
3658 | OldEnquiry->EventLogSequenceNumber) || | 3656 | OldEnquiry->EventLogSequenceNumber) || |
3659 | Controller->MonitoringTimerCount == 0 || | 3657 | Controller->MonitoringTimerCount == 0 || |
3660 | (jiffies - Controller->SecondaryMonitoringTime | 3658 | time_after_eq(jiffies, Controller->SecondaryMonitoringTime |
3661 | >= DAC960_SecondaryMonitoringInterval)) | 3659 | + DAC960_SecondaryMonitoringInterval)) |
3662 | { | 3660 | { |
3663 | Controller->V1.NeedLogicalDriveInformation = true; | 3661 | Controller->V1.NeedLogicalDriveInformation = true; |
3664 | Controller->V1.NewEventLogSequenceNumber = | 3662 | Controller->V1.NewEventLogSequenceNumber = |
@@ -5643,8 +5641,8 @@ static void DAC960_MonitoringTimerFunction(unsigned long TimerData) | |||
5643 | unsigned int StatusChangeCounter = | 5641 | unsigned int StatusChangeCounter = |
5644 | Controller->V2.HealthStatusBuffer->StatusChangeCounter; | 5642 | Controller->V2.HealthStatusBuffer->StatusChangeCounter; |
5645 | boolean ForceMonitoringCommand = false; | 5643 | boolean ForceMonitoringCommand = false; |
5646 | if (jiffies - Controller->SecondaryMonitoringTime | 5644 | if (time_after(jiffies, Controller->SecondaryMonitoringTime |
5647 | > DAC960_SecondaryMonitoringInterval) | 5645 | + DAC960_SecondaryMonitoringInterval)) |
5648 | { | 5646 | { |
5649 | int LogicalDriveNumber; | 5647 | int LogicalDriveNumber; |
5650 | for (LogicalDriveNumber = 0; | 5648 | for (LogicalDriveNumber = 0; |
@@ -5672,8 +5670,8 @@ static void DAC960_MonitoringTimerFunction(unsigned long TimerData) | |||
5672 | ControllerInfo->ConsistencyChecksActive + | 5670 | ControllerInfo->ConsistencyChecksActive + |
5673 | ControllerInfo->RebuildsActive + | 5671 | ControllerInfo->RebuildsActive + |
5674 | ControllerInfo->OnlineExpansionsActive == 0 || | 5672 | ControllerInfo->OnlineExpansionsActive == 0 || |
5675 | jiffies - Controller->PrimaryMonitoringTime | 5673 | time_before(jiffies, Controller->PrimaryMonitoringTime |
5676 | < DAC960_MonitoringTimerInterval) && | 5674 | + DAC960_MonitoringTimerInterval)) && |
5677 | !ForceMonitoringCommand) | 5675 | !ForceMonitoringCommand) |
5678 | { | 5676 | { |
5679 | Controller->MonitoringTimer.expires = | 5677 | Controller->MonitoringTimer.expires = |
@@ -5810,8 +5808,8 @@ static void DAC960_Message(DAC960_MessageLevel_T MessageLevel, | |||
5810 | Controller->ProgressBufferLength = Length; | 5808 | Controller->ProgressBufferLength = Length; |
5811 | if (Controller->EphemeralProgressMessage) | 5809 | if (Controller->EphemeralProgressMessage) |
5812 | { | 5810 | { |
5813 | if (jiffies - Controller->LastProgressReportTime | 5811 | if (time_after_eq(jiffies, Controller->LastProgressReportTime |
5814 | >= DAC960_ProgressReportingInterval) | 5812 | + DAC960_ProgressReportingInterval)) |
5815 | { | 5813 | { |
5816 | printk("%sDAC960#%d: %s", DAC960_MessageLevelMap[MessageLevel], | 5814 | printk("%sDAC960#%d: %s", DAC960_MessageLevelMap[MessageLevel], |
5817 | Controller->ControllerNumber, Buffer); | 5815 | Controller->ControllerNumber, Buffer); |
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index 875ae7699025..ae0949b3394f 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig | |||
@@ -383,8 +383,9 @@ config BLK_DEV_RAM | |||
383 | thus say N here. | 383 | thus say N here. |
384 | 384 | ||
385 | config BLK_DEV_RAM_COUNT | 385 | config BLK_DEV_RAM_COUNT |
386 | int "Default number of RAM disks" if BLK_DEV_RAM | 386 | int "Default number of RAM disks" |
387 | default "16" | 387 | default "16" |
388 | depends on BLK_DEV_RAM | ||
388 | help | 389 | help |
389 | The default value is 16 RAM disks. Change this if you know what | 390 | The default value is 16 RAM disks. Change this if you know what |
390 | are doing. If you boot from a filesystem that needs to be extracted | 391 | are doing. If you boot from a filesystem that needs to be extracted |
diff --git a/drivers/block/acsi_slm.c b/drivers/block/acsi_slm.c index a5c1c8e871ec..4cb9c1336287 100644 --- a/drivers/block/acsi_slm.c +++ b/drivers/block/acsi_slm.c | |||
@@ -369,8 +369,6 @@ static ssize_t slm_read( struct file *file, char *buf, size_t count, | |||
369 | int length; | 369 | int length; |
370 | int end; | 370 | int end; |
371 | 371 | ||
372 | if (count < 0) | ||
373 | return( -EINVAL ); | ||
374 | if (!(page = __get_free_page( GFP_KERNEL ))) | 372 | if (!(page = __get_free_page( GFP_KERNEL ))) |
375 | return( -ENOMEM ); | 373 | return( -ENOMEM ); |
376 | 374 | ||
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 71ec9e664383..1b0fd31c57c3 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -996,13 +996,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, | |||
996 | status = -EINVAL; | 996 | status = -EINVAL; |
997 | goto cleanup1; | 997 | goto cleanup1; |
998 | } | 998 | } |
999 | buff = (unsigned char **) kmalloc(MAXSGENTRIES * | 999 | buff = kzalloc(MAXSGENTRIES * sizeof(char *), GFP_KERNEL); |
1000 | sizeof(char *), GFP_KERNEL); | ||
1001 | if (!buff) { | 1000 | if (!buff) { |
1002 | status = -ENOMEM; | 1001 | status = -ENOMEM; |
1003 | goto cleanup1; | 1002 | goto cleanup1; |
1004 | } | 1003 | } |
1005 | memset(buff, 0, MAXSGENTRIES); | ||
1006 | buff_size = (int *) kmalloc(MAXSGENTRIES * sizeof(int), | 1004 | buff_size = (int *) kmalloc(MAXSGENTRIES * sizeof(int), |
1007 | GFP_KERNEL); | 1005 | GFP_KERNEL); |
1008 | if (!buff_size) { | 1006 | if (!buff_size) { |
@@ -2729,9 +2727,9 @@ static void __devinit cciss_interrupt_mode(ctlr_info_t *c, struct pci_dev *pdev, | |||
2729 | return; | 2727 | return; |
2730 | } | 2728 | } |
2731 | } | 2729 | } |
2730 | default_int_mode: | ||
2732 | #endif /* CONFIG_PCI_MSI */ | 2731 | #endif /* CONFIG_PCI_MSI */ |
2733 | /* if we get here we're going to use the default interrupt mode */ | 2732 | /* if we get here we're going to use the default interrupt mode */ |
2734 | default_int_mode: | ||
2735 | c->intr[SIMPLE_MODE_INT] = pdev->irq; | 2733 | c->intr[SIMPLE_MODE_INT] = pdev->irq; |
2736 | return; | 2734 | return; |
2737 | } | 2735 | } |
@@ -2940,13 +2938,12 @@ static void cciss_getgeometry(int cntl_num) | |||
2940 | int block_size; | 2938 | int block_size; |
2941 | int total_size; | 2939 | int total_size; |
2942 | 2940 | ||
2943 | ld_buff = kmalloc(sizeof(ReportLunData_struct), GFP_KERNEL); | 2941 | ld_buff = kzalloc(sizeof(ReportLunData_struct), GFP_KERNEL); |
2944 | if (ld_buff == NULL) | 2942 | if (ld_buff == NULL) |
2945 | { | 2943 | { |
2946 | printk(KERN_ERR "cciss: out of memory\n"); | 2944 | printk(KERN_ERR "cciss: out of memory\n"); |
2947 | return; | 2945 | return; |
2948 | } | 2946 | } |
2949 | memset(ld_buff, 0, sizeof(ReportLunData_struct)); | ||
2950 | size_buff = kmalloc(sizeof( ReadCapdata_struct), GFP_KERNEL); | 2947 | size_buff = kmalloc(sizeof( ReadCapdata_struct), GFP_KERNEL); |
2951 | if (size_buff == NULL) | 2948 | if (size_buff == NULL) |
2952 | { | 2949 | { |
@@ -3060,10 +3057,9 @@ static int alloc_cciss_hba(void) | |||
3060 | for(i=0; i< MAX_CTLR; i++) { | 3057 | for(i=0; i< MAX_CTLR; i++) { |
3061 | if (!hba[i]) { | 3058 | if (!hba[i]) { |
3062 | ctlr_info_t *p; | 3059 | ctlr_info_t *p; |
3063 | p = kmalloc(sizeof(ctlr_info_t), GFP_KERNEL); | 3060 | p = kzalloc(sizeof(ctlr_info_t), GFP_KERNEL); |
3064 | if (!p) | 3061 | if (!p) |
3065 | goto Enomem; | 3062 | goto Enomem; |
3066 | memset(p, 0, sizeof(ctlr_info_t)); | ||
3067 | for (n = 0; n < NWD; n++) | 3063 | for (n = 0; n < NWD; n++) |
3068 | p->gendisk[n] = disk[n]; | 3064 | p->gendisk[n] = disk[n]; |
3069 | hba[i] = p; | 3065 | hba[i] = p; |
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 0e66e904bd8c..597c007fe81b 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
@@ -1027,12 +1027,11 @@ cciss_update_non_disk_devices(int cntl_num, int hostno) | |||
1027 | int i; | 1027 | int i; |
1028 | 1028 | ||
1029 | c = (ctlr_info_t *) hba[cntl_num]; | 1029 | c = (ctlr_info_t *) hba[cntl_num]; |
1030 | ld_buff = kmalloc(reportlunsize, GFP_KERNEL); | 1030 | ld_buff = kzalloc(reportlunsize, GFP_KERNEL); |
1031 | if (ld_buff == NULL) { | 1031 | if (ld_buff == NULL) { |
1032 | printk(KERN_ERR "cciss: out of memory\n"); | 1032 | printk(KERN_ERR "cciss: out of memory\n"); |
1033 | return; | 1033 | return; |
1034 | } | 1034 | } |
1035 | memset(ld_buff, 0, reportlunsize); | ||
1036 | inq_buff = kmalloc(OBDR_TAPE_INQ_SIZE, GFP_KERNEL); | 1035 | inq_buff = kmalloc(OBDR_TAPE_INQ_SIZE, GFP_KERNEL); |
1037 | if (inq_buff == NULL) { | 1036 | if (inq_buff == NULL) { |
1038 | printk(KERN_ERR "cciss: out of memory\n"); | 1037 | printk(KERN_ERR "cciss: out of memory\n"); |
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index d3ad9081697e..bedb689b051f 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -170,6 +170,7 @@ static int print_unex = 1; | |||
170 | #include <linux/mm.h> | 170 | #include <linux/mm.h> |
171 | #include <linux/bio.h> | 171 | #include <linux/bio.h> |
172 | #include <linux/string.h> | 172 | #include <linux/string.h> |
173 | #include <linux/jiffies.h> | ||
173 | #include <linux/fcntl.h> | 174 | #include <linux/fcntl.h> |
174 | #include <linux/delay.h> | 175 | #include <linux/delay.h> |
175 | #include <linux/mc146818rtc.h> /* CMOS defines */ | 176 | #include <linux/mc146818rtc.h> /* CMOS defines */ |
@@ -747,7 +748,7 @@ static int disk_change(int drive) | |||
747 | { | 748 | { |
748 | int fdc = FDC(drive); | 749 | int fdc = FDC(drive); |
749 | #ifdef FLOPPY_SANITY_CHECK | 750 | #ifdef FLOPPY_SANITY_CHECK |
750 | if (jiffies - UDRS->select_date < UDP->select_delay) | 751 | if (time_before(jiffies, UDRS->select_date + UDP->select_delay)) |
751 | DPRINT("WARNING disk change called early\n"); | 752 | DPRINT("WARNING disk change called early\n"); |
752 | if (!(FDCS->dor & (0x10 << UNIT(drive))) || | 753 | if (!(FDCS->dor & (0x10 << UNIT(drive))) || |
753 | (FDCS->dor & 3) != UNIT(drive) || fdc != FDC(drive)) { | 754 | (FDCS->dor & 3) != UNIT(drive) || fdc != FDC(drive)) { |
@@ -1075,7 +1076,7 @@ static int fd_wait_for_completion(unsigned long delay, timeout_fn function) | |||
1075 | return 1; | 1076 | return 1; |
1076 | } | 1077 | } |
1077 | 1078 | ||
1078 | if ((signed)(jiffies - delay) < 0) { | 1079 | if (time_before(jiffies, delay)) { |
1079 | del_timer(&fd_timer); | 1080 | del_timer(&fd_timer); |
1080 | fd_timer.function = function; | 1081 | fd_timer.function = function; |
1081 | fd_timer.expires = delay; | 1082 | fd_timer.expires = delay; |
@@ -1535,7 +1536,7 @@ static void setup_rw_floppy(void) | |||
1535 | * again just before spinup completion. Beware that | 1536 | * again just before spinup completion. Beware that |
1536 | * after scandrives, we must again wait for selection. | 1537 | * after scandrives, we must again wait for selection. |
1537 | */ | 1538 | */ |
1538 | if ((signed)(ready_date - jiffies) > DP->select_delay) { | 1539 | if (time_after(ready_date, jiffies + DP->select_delay)) { |
1539 | ready_date -= DP->select_delay; | 1540 | ready_date -= DP->select_delay; |
1540 | function = (timeout_fn) floppy_start; | 1541 | function = (timeout_fn) floppy_start; |
1541 | } else | 1542 | } else |
@@ -3823,7 +3824,7 @@ static int check_floppy_change(struct gendisk *disk) | |||
3823 | if (UTESTF(FD_DISK_CHANGED) || UTESTF(FD_VERIFY)) | 3824 | if (UTESTF(FD_DISK_CHANGED) || UTESTF(FD_VERIFY)) |
3824 | return 1; | 3825 | return 1; |
3825 | 3826 | ||
3826 | if (UDP->checkfreq < (int)(jiffies - UDRS->last_checked)) { | 3827 | if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) { |
3827 | if (floppy_grab_irq_and_dma()) { | 3828 | if (floppy_grab_irq_and_dma()) { |
3828 | return 1; | 3829 | return 1; |
3829 | } | 3830 | } |
diff --git a/drivers/block/paride/bpck6.c b/drivers/block/paride/bpck6.c index 08d858ad64db..41a237c5957d 100644 --- a/drivers/block/paride/bpck6.c +++ b/drivers/block/paride/bpck6.c | |||
@@ -224,10 +224,9 @@ static void bpck6_log_adapter( PIA *pi, char * scratch, int verbose ) | |||
224 | 224 | ||
225 | static int bpck6_init_proto(PIA *pi) | 225 | static int bpck6_init_proto(PIA *pi) |
226 | { | 226 | { |
227 | Interface *p = kmalloc(sizeof(Interface), GFP_KERNEL); | 227 | Interface *p = kzalloc(sizeof(Interface), GFP_KERNEL); |
228 | 228 | ||
229 | if (p) { | 229 | if (p) { |
230 | memset(p, 0, sizeof(Interface)); | ||
231 | pi->private = (unsigned long)p; | 230 | pi->private = (unsigned long)p; |
232 | return 0; | 231 | return 0; |
233 | } | 232 | } |
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 62d2464c12f2..2403721f9db1 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -151,6 +151,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_GEO, D_SBY, D_DLY, D_SLV}; | |||
151 | #include <linux/cdrom.h> /* for the eject ioctl */ | 151 | #include <linux/cdrom.h> /* for the eject ioctl */ |
152 | #include <linux/blkdev.h> | 152 | #include <linux/blkdev.h> |
153 | #include <linux/blkpg.h> | 153 | #include <linux/blkpg.h> |
154 | #include <linux/kernel.h> | ||
154 | #include <asm/uaccess.h> | 155 | #include <asm/uaccess.h> |
155 | #include <linux/sched.h> | 156 | #include <linux/sched.h> |
156 | #include <linux/workqueue.h> | 157 | #include <linux/workqueue.h> |
@@ -275,7 +276,7 @@ static void pd_print_error(struct pd_unit *disk, char *msg, int status) | |||
275 | int i; | 276 | int i; |
276 | 277 | ||
277 | printk("%s: %s: status = 0x%x =", disk->name, msg, status); | 278 | printk("%s: %s: status = 0x%x =", disk->name, msg, status); |
278 | for (i = 0; i < 18; i++) | 279 | for (i = 0; i < ARRAY_SIZE(pd_errs); i++) |
279 | if (status & (1 << i)) | 280 | if (status & (1 << i)) |
280 | printk(" %s", pd_errs[i]); | 281 | printk(" %s", pd_errs[i]); |
281 | printk("\n"); | 282 | printk("\n"); |
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c index 6f5df0fad703..79b868254032 100644 --- a/drivers/block/paride/pg.c +++ b/drivers/block/paride/pg.c | |||
@@ -643,7 +643,8 @@ static ssize_t pg_read(struct file *filp, char __user *buf, size_t count, loff_t | |||
643 | 643 | ||
644 | static int __init pg_init(void) | 644 | static int __init pg_init(void) |
645 | { | 645 | { |
646 | int unit, err = 0; | 646 | int unit; |
647 | int err; | ||
647 | 648 | ||
648 | if (disable){ | 649 | if (disable){ |
649 | err = -1; | 650 | err = -1; |
@@ -657,16 +658,17 @@ static int __init pg_init(void) | |||
657 | goto out; | 658 | goto out; |
658 | } | 659 | } |
659 | 660 | ||
660 | if (register_chrdev(major, name, &pg_fops)) { | 661 | err = register_chrdev(major, name, &pg_fops); |
662 | if (err < 0) { | ||
661 | printk("pg_init: unable to get major number %d\n", major); | 663 | printk("pg_init: unable to get major number %d\n", major); |
662 | for (unit = 0; unit < PG_UNITS; unit++) { | 664 | for (unit = 0; unit < PG_UNITS; unit++) { |
663 | struct pg *dev = &devices[unit]; | 665 | struct pg *dev = &devices[unit]; |
664 | if (dev->present) | 666 | if (dev->present) |
665 | pi_release(dev->pi); | 667 | pi_release(dev->pi); |
666 | } | 668 | } |
667 | err = -1; | ||
668 | goto out; | 669 | goto out; |
669 | } | 670 | } |
671 | major = err; /* In case the user specified `major=0' (dynamic) */ | ||
670 | pg_class = class_create(THIS_MODULE, "pg"); | 672 | pg_class = class_create(THIS_MODULE, "pg"); |
671 | if (IS_ERR(pg_class)) { | 673 | if (IS_ERR(pg_class)) { |
672 | err = PTR_ERR(pg_class); | 674 | err = PTR_ERR(pg_class); |
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c index 715ae5dc88fb..d2013d362403 100644 --- a/drivers/block/paride/pt.c +++ b/drivers/block/paride/pt.c | |||
@@ -943,7 +943,8 @@ static ssize_t pt_write(struct file *filp, const char __user *buf, size_t count, | |||
943 | 943 | ||
944 | static int __init pt_init(void) | 944 | static int __init pt_init(void) |
945 | { | 945 | { |
946 | int unit, err = 0; | 946 | int unit; |
947 | int err; | ||
947 | 948 | ||
948 | if (disable) { | 949 | if (disable) { |
949 | err = -1; | 950 | err = -1; |
@@ -955,14 +956,15 @@ static int __init pt_init(void) | |||
955 | goto out; | 956 | goto out; |
956 | } | 957 | } |
957 | 958 | ||
958 | if (register_chrdev(major, name, &pt_fops)) { | 959 | err = register_chrdev(major, name, &pt_fops); |
960 | if (err < 0) { | ||
959 | printk("pt_init: unable to get major number %d\n", major); | 961 | printk("pt_init: unable to get major number %d\n", major); |
960 | for (unit = 0; unit < PT_UNITS; unit++) | 962 | for (unit = 0; unit < PT_UNITS; unit++) |
961 | if (pt[unit].present) | 963 | if (pt[unit].present) |
962 | pi_release(pt[unit].pi); | 964 | pi_release(pt[unit].pi); |
963 | err = -1; | ||
964 | goto out; | 965 | goto out; |
965 | } | 966 | } |
967 | major = err; | ||
966 | pt_class = class_create(THIS_MODULE, "pt"); | 968 | pt_class = class_create(THIS_MODULE, "pt"); |
967 | if (IS_ERR(pt_class)) { | 969 | if (IS_ERR(pt_class)) { |
968 | err = PTR_ERR(pt_class); | 970 | err = PTR_ERR(pt_class); |
diff --git a/drivers/block/umem.c b/drivers/block/umem.c index c16e66b9c7a7..f7d4c65a7b8c 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <linux/timer.h> | 50 | #include <linux/timer.h> |
51 | #include <linux/pci.h> | 51 | #include <linux/pci.h> |
52 | #include <linux/slab.h> | 52 | #include <linux/slab.h> |
53 | #include <linux/dma-mapping.h> | ||
53 | 54 | ||
54 | #include <linux/fcntl.h> /* O_ACCMODE */ | 55 | #include <linux/fcntl.h> /* O_ACCMODE */ |
55 | #include <linux/hdreg.h> /* HDIO_GETGEO */ | 56 | #include <linux/hdreg.h> /* HDIO_GETGEO */ |
@@ -881,8 +882,8 @@ static int __devinit mm_pci_probe(struct pci_dev *dev, const struct pci_device_i | |||
881 | printk(KERN_INFO "Micro Memory(tm) controller #%d found at %02x:%02x (PCI Mem Module (Battery Backup))\n", | 882 | printk(KERN_INFO "Micro Memory(tm) controller #%d found at %02x:%02x (PCI Mem Module (Battery Backup))\n", |
882 | card->card_number, dev->bus->number, dev->devfn); | 883 | card->card_number, dev->bus->number, dev->devfn); |
883 | 884 | ||
884 | if (pci_set_dma_mask(dev, 0xffffffffffffffffLL) && | 885 | if (pci_set_dma_mask(dev, DMA_64BIT_MASK) && |
885 | pci_set_dma_mask(dev, 0xffffffffLL)) { | 886 | pci_set_dma_mask(dev, DMA_32BIT_MASK)) { |
886 | printk(KERN_WARNING "MM%d: NO suitable DMA found\n",num_cards); | 887 | printk(KERN_WARNING "MM%d: NO suitable DMA found\n",num_cards); |
887 | return -ENOMEM; | 888 | return -ENOMEM; |
888 | } | 889 | } |