Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[sfrench/cifs-2.6.git] / drivers / mfd / ucb1x00-core.c
index 632bc218c86a0388328ff07c7b27ea336d892ff9..f6b10dda31fdfd3f09bc070446956b1113b61f3f 100644 (file)
@@ -203,7 +203,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;
@@ -458,7 +458,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);
@@ -466,7 +466,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)
@@ -479,21 +479,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;
+       strlcpy(ucb->dev.bus_id, "ucb1x00", sizeof(ucb->dev.bus_id));
 
        spin_lock_init(&ucb->lock);
        spin_lock_init(&ucb->io_lock);
@@ -518,7 +517,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;
 
@@ -555,7 +554,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)