projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge ../linus
[powerpc.git]
/
drivers
/
i2c
/
busses
/
scx200_acb.c
diff --git
a/drivers/i2c/busses/scx200_acb.c
b/drivers/i2c/busses/scx200_acb.c
index
ced309f
..
714bae7
100644
(file)
--- a/
drivers/i2c/busses/scx200_acb.c
+++ b/
drivers/i2c/busses/scx200_acb.c
@@
-232,7
+232,7
@@
static void scx200_acb_poll(struct scx200_acb_iface *iface)
unsigned long timeout;
timeout = jiffies + POLL_TIMEOUT;
unsigned long timeout;
timeout = jiffies + POLL_TIMEOUT;
- while (
time_before(jiffies, timeout)
) {
+ while (
1
) {
status = inb(ACBST);
/* Reset the status register to avoid the hang */
status = inb(ACBST);
/* Reset the status register to avoid the hang */
@@
-242,7
+242,10
@@
static void scx200_acb_poll(struct scx200_acb_iface *iface)
scx200_acb_machine(iface, status);
return;
}
scx200_acb_machine(iface, status);
return;
}
- yield();
+ if (time_after(jiffies, timeout))
+ break;
+ cpu_relax();
+ cond_resched();
}
dev_err(&iface->adapter.dev, "timeout in state %s\n",
}
dev_err(&iface->adapter.dev, "timeout in state %s\n",
@@
-380,7
+383,7
@@
static u32 scx200_acb_func(struct i2c_adapter *adapter)
}
/* For now, we only handle combined mode (smbus) */
}
/* For now, we only handle combined mode (smbus) */
-static struct i2c_algorithm scx200_acb_algorithm = {
+static
const
struct i2c_algorithm scx200_acb_algorithm = {
.smbus_xfer = scx200_acb_smbus_xfer,
.functionality = scx200_acb_func,
};
.smbus_xfer = scx200_acb_smbus_xfer,
.functionality = scx200_acb_func,
};
@@
-491,11
+494,12
@@
static __init int scx200_create_pci(const char *text, struct pci_dev *pdev,
iface->pdev = pdev;
iface->bar = bar;
iface->pdev = pdev;
iface->bar = bar;
- pci_enable_device_bars(iface->pdev, 1 << iface->bar);
+ rc = pci_enable_device_bars(iface->pdev, 1 << iface->bar);
+ if (rc)
+ goto errout_free;
rc = pci_request_region(iface->pdev, iface->bar, iface->adapter.name);
rc = pci_request_region(iface->pdev, iface->bar, iface->adapter.name);
-
- if (rc != 0) {
+ if (rc) {
printk(KERN_ERR NAME ": can't allocate PCI BAR %d\n",
iface->bar);
goto errout_free;
printk(KERN_ERR NAME ": can't allocate PCI BAR %d\n",
iface->bar);
goto errout_free;