diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/macserial.c | 2 | ||||
-rw-r--r-- | drivers/macintosh/mediabay.c | 8 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu.c | 16 |
3 files changed, 17 insertions, 9 deletions
diff --git a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c index 5af8ad871..84f88cd75 100644 --- a/drivers/macintosh/macserial.c +++ b/drivers/macintosh/macserial.c @@ -1328,7 +1328,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout) schedule_timeout(char_time); if (signal_pending(current)) break; - if (timeout && ((orig_jiffies + timeout) < jiffies)) + if (timeout && time_after(jiffies, orig_jiffies + timeout)) break; } current->state = TASK_RUNNING; diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index 13ce064f4..30ecbd4e0 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c @@ -180,7 +180,7 @@ check_media_bay(struct device_node *which_bay, int what) { #ifdef CONFIG_BLK_DEV_IDE int i; - + for (i=0; i<media_bay_count; i++) if (which_bay == media_bays[i].dev_node) { @@ -196,9 +196,9 @@ check_media_bay(struct device_node *which_bay, int what) int check_media_bay_by_base(unsigned long base, int what) { +#ifdef CONFIG_BLK_DEV_IDE int i; -#ifdef CONFIG_BLK_DEV_IDE for (i=0; i<media_bay_count; i++) if (base == media_bays[i].cd_base) { @@ -216,9 +216,9 @@ int media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base, int irq, int index) { - int i; - #ifdef CONFIG_BLK_DEV_IDE + int i; + for (i=0; i<media_bay_count; i++) if (which_bay == media_bays[i].dev_node) { diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 4dd82fef9..3b027da3f 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -523,7 +523,7 @@ via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs) int intr; int nloop = 0; - while ((intr = (in_8(&via[IFR]) & (SR_INT | CB1_INT))) != 0) { + while ((intr = in_8(&via[IFR])) != 0) { if (++nloop > 1000) { printk(KERN_DEBUG "PMU: stuck in intr loop, " "intr=%x pmu_state=%d\n", intr, pmu_state); @@ -534,6 +534,12 @@ via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs) else if (intr & CB1_INT) { adb_int_pending = 1; out_8(&via[IFR], CB1_INT); + } else + { + /* -- Disabled printk, will happen _really_ often on + PowerBooks ((CB2 interrupts) -- + printk(KERN_DEBUG "PMU: spurrious interrupt intr=%x\n", intr); */ + out_8(&via[IFR], intr); } } if (pmu_state == idle) { @@ -750,7 +756,8 @@ pmu_restart(void) _disable_interrupts(); - pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, CB1_INT); + pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, PMU_INT_ADB | + PMU_INT_TICK ); while(!req.complete) pmu_poll(); @@ -768,7 +775,8 @@ pmu_shutdown(void) _disable_interrupts(); - pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, CB1_INT); + pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, PMU_INT_ADB | + PMU_INT_TICK ); while(!req.complete) pmu_poll(); @@ -886,7 +894,7 @@ int powerbook_sleep(void) pmu_enable_backlight(0); /* Give the disks a little time to actually finish writing */ - for (wait = jiffies + (HZ/4); jiffies < wait; ) + for (wait = jiffies + (HZ/4); time_before(jiffies, wait); ) mb(); /* Disable all interrupts except pmu */ |