summaryrefslogtreecommitdiffstats
path: root/drivers/ide/hd.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-11 04:02:40 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-11 04:02:40 +0000
commite47f00743fc4776491344f2c618cc8dc2c23bcbc (patch)
tree13e03a113a82a184c51c19c209867cfd3a59b3b9 /drivers/ide/hd.c
parentb2ad5f821b1381492d792ca10b1eb7a107b48f14 (diff)
Merge with Linux 2.4.0.
Diffstat (limited to 'drivers/ide/hd.c')
-rw-r--r--drivers/ide/hd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/ide/hd.c b/drivers/ide/hd.c
index ca3a5c72b..bed5f6210 100644
--- a/drivers/ide/hd.c
+++ b/drivers/ide/hd.c
@@ -738,6 +738,7 @@ static void __init hd_geninit(void)
if (!NR_HD) {
extern struct drive_info drive_info;
unsigned char *BIOS = (unsigned char *) &drive_info;
+ unsigned long flags;
int cmos_disks;
for (drive=0 ; drive<2 ; drive++) {
@@ -773,10 +774,15 @@ static void __init hd_geninit(void)
Needless to say, a non-zero value means we have
an AT controller hard disk for that drive.
-
+ Currently the rtc_lock is a bit academic since this
+ driver is non-modular, but someday... ? Paul G.
*/
- if ((cmos_disks = CMOS_READ(0x12)) & 0xf0) {
+ spin_lock_irqsave(&rtc_lock, flags);
+ cmos_disks = CMOS_READ(0x12);
+ spin_unlock_irqrestore(&rtc_lock, flags);
+
+ if (cmos_disks & 0xf0) {
if (cmos_disks & 0x0f)
NR_HD = 2;
else