};
#endif /* DEBUG */
+static int probe;
+
MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
MODULE_DESCRIPTION("I2C driver for Apple's Keywest");
MODULE_LICENSE("GPL");
-MODULE_PARM(probe, "i");
-
-static int probe = 0;
+module_param(probe, bool, 0);
#ifdef POLLED_MODE
/* Don't schedule, the g5 fan controller is too
iface->irq = np->intrs[0].line;
iface->channels = (struct keywest_chan *)
(((unsigned long)(iface + 1) + 3UL) & ~3UL);
- iface->base = (unsigned long)ioremap(np->addrs[0].address + addroffset,
+ iface->base = ioremap(np->addrs[0].address + addroffset,
np->addrs[0].size);
- if (iface->base == 0) {
+ if (!iface->base) {
printk(KERN_ERR "i2c-keywest: can't map inteface !\n");
kfree(iface);
pmac_low_i2c_unlock(np);
rc = request_irq(iface->irq, keywest_irq, SA_INTERRUPT, "keywest i2c", iface);
if (rc) {
printk(KERN_ERR "i2c-keywest: can't get IRQ %d !\n", iface->irq);
- iounmap((void *)iface->base);
+ iounmap(iface->base);
kfree(iface);
pmac_low_i2c_unlock(np);
return -ENODEV;
spin_lock_irq(&iface->lock);
while (iface->state != state_idle) {
spin_unlock_irq(&iface->lock);
- set_task_state(current,TASK_UNINTERRUPTIBLE);
- schedule_timeout(HZ/10);
+ msleep(100);
spin_lock_irq(&iface->lock);
}
#endif /* POLLED_MODE */
if (rc)
printk("i2c-keywest.c: i2c_del_adapter failed, that's bad !\n");
}
- iounmap((void *)iface->base);
+ iounmap(iface->base);
dev_set_drvdata(dev, NULL);
of_node_put(iface->node);
kfree(iface);