headers: remove sched.h from interrupt.h
[safe/jmp/linux-2.6] / drivers / mfd / ucb1x00-core.c
index aff83f9..60c3988 100644 (file)
@@ -16,9 +16,9 @@
  *  Note that all locks are private to this file.  Nothing else may
  *  touch them.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/errno.h>
@@ -26,8 +26,8 @@
 #include <linux/device.h>
 #include <linux/mutex.h>
 
-#include <asm/dma.h>
-#include <asm/hardware.h>
+#include <mach/dma.h>
+#include <mach/hardware.h>
 
 #include "ucb1x00.h"
 
@@ -204,7 +204,7 @@ void ucb1x00_adc_disable(struct ucb1x00 *ucb)
  * SIBCLK to talk to the chip.  We leave the clock running until
  * we have finished processing all interrupts from the chip.
  */
-static irqreturn_t ucb1x00_irq(int irqnr, void *devid, struct pt_regs *regs)
+static irqreturn_t ucb1x00_irq(int irqnr, void *devid)
 {
        struct ucb1x00 *ucb = devid;
        struct ucb1x00_irq *irq;
@@ -420,8 +420,10 @@ static int ucb1x00_detect_irq(struct ucb1x00 *ucb)
        unsigned long mask;
 
        mask = probe_irq_on();
-       if (!mask)
+       if (!mask) {
+               probe_irq_off(mask);
                return NO_IRQ;
+       }
 
        /*
         * Enable the ADC interrupt.
@@ -457,7 +459,7 @@ static int ucb1x00_detect_irq(struct ucb1x00 *ucb)
        return probe_irq_off(mask);
 }
 
-static void ucb1x00_release(struct class_device *dev)
+static void ucb1x00_release(struct device *dev)
 {
        struct ucb1x00 *ucb = classdev_to_ucb1x00(dev);
        kfree(ucb);
@@ -465,7 +467,7 @@ static void ucb1x00_release(struct class_device *dev)
 
 static struct class ucb1x00_class = {
        .name           = "ucb1x00",
-       .release        = ucb1x00_release,
+       .dev_release    = ucb1x00_release,
 };
 
 static int ucb1x00_probe(struct mcp *mcp)
@@ -478,21 +480,20 @@ static int ucb1x00_probe(struct mcp *mcp)
        mcp_enable(mcp);
        id = mcp_reg_read(mcp, UCB_ID);
 
-       if (id != UCB_ID_1200 && id != UCB_ID_1300) {
+       if (id != UCB_ID_1200 && id != UCB_ID_1300 && id != UCB_ID_TC35143) {
                printk(KERN_WARNING "UCB1x00 ID not found: %04x\n", id);
                goto err_disable;
        }
 
-       ucb = kmalloc(sizeof(struct ucb1x00), GFP_KERNEL);
+       ucb = kzalloc(sizeof(struct ucb1x00), GFP_KERNEL);
        ret = -ENOMEM;
        if (!ucb)
                goto err_disable;
 
-       memset(ucb, 0, sizeof(struct ucb1x00));
 
-       ucb->cdev.class = &ucb1x00_class;
-       ucb->cdev.dev = &mcp->attached_device;
-       strlcpy(ucb->cdev.class_id, "ucb1x00", sizeof(ucb->cdev.class_id));
+       ucb->dev.class = &ucb1x00_class;
+       ucb->dev.parent = &mcp->attached_device;
+       dev_set_name(&ucb->dev, "ucb1x00");
 
        spin_lock_init(&ucb->lock);
        spin_lock_init(&ucb->io_lock);
@@ -507,7 +508,7 @@ static int ucb1x00_probe(struct mcp *mcp)
                goto err_free;
        }
 
-       ret = request_irq(ucb->irq, ucb1x00_irq, SA_TRIGGER_RISING,
+       ret = request_irq(ucb->irq, ucb1x00_irq, IRQF_TRIGGER_RISING,
                          "UCB1x00", ucb);
        if (ret) {
                printk(KERN_ERR "ucb1x00: unable to grab irq%d: %d\n",
@@ -517,7 +518,7 @@ static int ucb1x00_probe(struct mcp *mcp)
 
        mcp_set_drvdata(mcp, ucb);
 
-       ret = class_device_register(&ucb->cdev);
+       ret = device_register(&ucb->dev);
        if (ret)
                goto err_irq;
 
@@ -554,7 +555,7 @@ static void ucb1x00_remove(struct mcp *mcp)
        mutex_unlock(&ucb1x00_mutex);
 
        free_irq(ucb->irq, ucb);
-       class_device_unregister(&ucb->cdev);
+       device_unregister(&ucb->dev);
 }
 
 int ucb1x00_register_driver(struct ucb1x00_driver *drv)