Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96384
b: refs/heads/master
c: f5fff36
h: refs/heads/master
v: v3
  • Loading branch information
Jon Smirl authored and Jean Delvare committed May 11, 2008
1 parent 1fe4752 commit 9a90613
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c3921ab71507b108d51a0f1ee960f80cd668a93d
refs/heads/master: f5fff3602a67ff8c98fccdbf15959780be542802
16 changes: 7 additions & 9 deletions trunk/drivers/i2c/busses/i2c-mpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand All @@ -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
Expand All @@ -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;
};
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 1 addition & 5 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -2037,24 +2037,20 @@ 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();
}
#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
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand All @@ -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,
Expand Down

0 comments on commit 9a90613

Please sign in to comment.