From 9a90613644edb87fc12631fec5bf1abac9c34570 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Sun, 11 May 2008 20:37:04 +0200 Subject: [PATCH] --- yaml --- r: 96384 b: refs/heads/master c: f5fff3602a67ff8c98fccdbf15959780be542802 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/i2c/busses/i2c-mpc.c | 16 +++++++--------- trunk/fs/locks.c | 2 +- trunk/include/linux/sched.h | 6 +----- trunk/kernel/sched.c | 2 ++ 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index e0f5d4a88dd1..dd2b9755b52f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c3921ab71507b108d51a0f1ee960f80cd668a93d +refs/heads/master: f5fff3602a67ff8c98fccdbf15959780be542802 diff --git a/trunk/drivers/i2c/busses/i2c-mpc.c b/trunk/drivers/i2c/busses/i2c-mpc.c index 18beb0ad7bf3..a076129de7e8 100644 --- a/trunk/drivers/i2c/busses/i2c-mpc.c +++ b/trunk/drivers/i2c/busses/i2c-mpc.c @@ -99,7 +99,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing) u32 x; int result = 0; - if (i2c->irq == 0) + if (i2c->irq == NO_IRQ) { while (!(readb(i2c->base + MPC_I2C_SR) & CSR_MIF)) { schedule(); @@ -329,10 +329,9 @@ static int fsl_i2c_probe(struct platform_device *pdev) return -ENOMEM; i2c->irq = platform_get_irq(pdev, 0); - if (i2c->irq < 0) { - result = -ENXIO; - goto fail_get_irq; - } + if (i2c->irq < 0) + i2c->irq = NO_IRQ; /* Use polling */ + i2c->flags = pdata->device_flags; init_waitqueue_head(&i2c->queue); @@ -344,7 +343,7 @@ static int fsl_i2c_probe(struct platform_device *pdev) goto fail_map; } - if (i2c->irq != 0) + if (i2c->irq != NO_IRQ) if ((result = request_irq(i2c->irq, mpc_i2c_isr, IRQF_SHARED, "i2c-mpc", i2c)) < 0) { printk(KERN_ERR @@ -367,12 +366,11 @@ static int fsl_i2c_probe(struct platform_device *pdev) return result; fail_add: - if (i2c->irq != 0) + if (i2c->irq != NO_IRQ) free_irq(i2c->irq, i2c); fail_irq: iounmap(i2c->base); fail_map: - fail_get_irq: kfree(i2c); return result; }; @@ -384,7 +382,7 @@ static int fsl_i2c_remove(struct platform_device *pdev) i2c_del_adapter(&i2c->adap); platform_set_drvdata(pdev, NULL); - if (i2c->irq != 0) + if (i2c->irq != NO_IRQ) free_irq(i2c->irq, i2c); iounmap(i2c->base); diff --git a/trunk/fs/locks.c b/trunk/fs/locks.c index 11dbf08651b7..0ac6b92cb0b6 100644 --- a/trunk/fs/locks.c +++ b/trunk/fs/locks.c @@ -773,7 +773,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) * give it the opportunity to lock the file. */ if (found) - cond_resched_bkl(); + cond_resched(); find_conflict: for_each_lock(inode, before) { diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 4ab9f32f9238..0c35b0343a76 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -2037,13 +2037,13 @@ static inline int need_resched(void) * cond_resched_lock() will drop the spinlock before scheduling, * cond_resched_softirq() will enable bhs before scheduling. */ -extern int _cond_resched(void); #ifdef CONFIG_PREEMPT static inline int cond_resched(void) { return 0; } #else +extern int _cond_resched(void); static inline int cond_resched(void) { return _cond_resched(); @@ -2051,10 +2051,6 @@ static inline int cond_resched(void) #endif extern int cond_resched_lock(spinlock_t * lock); extern int cond_resched_softirq(void); -static inline int cond_resched_bkl(void) -{ - return _cond_resched(); -} /* * Does a critical section need to be broken due to another diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 8841a915545d..c51b6565e07c 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -5525,6 +5525,7 @@ static void __cond_resched(void) } while (need_resched()); } +#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PREEMPT_VOLUNTARY) int __sched _cond_resched(void) { if (need_resched() && !(preempt_count() & PREEMPT_ACTIVE) && @@ -5535,6 +5536,7 @@ int __sched _cond_resched(void) return 0; } EXPORT_SYMBOL(_cond_resched); +#endif /* * cond_resched_lock() - if a reschedule is pending, drop the given lock,