vserver 2.0 rc7
[linux-2.6.git] / drivers / i2c / busses / i2c-elektor.c
index 2fda2b8..0a77200 100644 (file)
@@ -110,22 +110,23 @@ static int pcf_isa_getclock(void *data)
 }
 
 static void pcf_isa_waitforpin(void) {
-
+       DEFINE_WAIT(wait);
        int timeout = 2;
-       long flags;
+       unsigned long flags;
 
        if (irq > 0) {
                spin_lock_irqsave(&lock, flags);
                if (pcf_pending == 0) {
                        spin_unlock_irqrestore(&lock, flags);
-                       if (interruptible_sleep_on_timeout(&pcf_wait,
-                                                               timeout*HZ)) {
+                       prepare_to_wait(&pcf_wait, &wait, TASK_INTERRUPTIBLE);
+                       if (schedule_timeout(timeout*HZ)) {
                                spin_lock_irqsave(&lock, flags);
                                if (pcf_pending == 1) {
                                        pcf_pending = 0;
                                }
                                spin_unlock_irqrestore(&lock, flags);
                        }
+                       finish_wait(&pcf_wait, &wait);
                } else {
                        pcf_pending = 0;
                        spin_unlock_irqrestore(&lock, flags);
@@ -183,6 +184,7 @@ static struct i2c_algo_pcf_data pcf_isa_data = {
 
 static struct i2c_adapter pcf_isa_ops = {
        .owner          = THIS_MODULE,
+       .class          = I2C_CLASS_HWMON,
        .id             = I2C_HW_P_ELEK,
        .algo_data      = &pcf_isa_data,
        .name           = "PCF8584 ISA adapter",