of: Remove duplicate fields from of_platform_driver
[pandora-kernel.git] / drivers / i2c / busses / i2c-ibm_iic.c
index 8b92a46..3876f99 100644 (file)
@@ -85,10 +85,11 @@ static void dump_iic_regs(const char* header, struct ibm_iic_private* dev)
 {
        volatile struct iic_regs __iomem *iic = dev->vaddr;
        printk(KERN_DEBUG "ibm-iic%d: %s\n", dev->idx, header);
-       printk(KERN_DEBUG "  cntl     = 0x%02x, mdcntl = 0x%02x\n"
-              KERN_DEBUG "  sts      = 0x%02x, extsts = 0x%02x\n"
-              KERN_DEBUG "  clkdiv   = 0x%02x, xfrcnt = 0x%02x\n"
-              KERN_DEBUG "  xtcntlss = 0x%02x, directcntl = 0x%02x\n",
+       printk(KERN_DEBUG
+              "  cntl     = 0x%02x, mdcntl = 0x%02x\n"
+              "  sts      = 0x%02x, extsts = 0x%02x\n"
+              "  clkdiv   = 0x%02x, xfrcnt = 0x%02x\n"
+              "  xtcntlss = 0x%02x, directcntl = 0x%02x\n",
                in_8(&iic->cntl), in_8(&iic->mdcntl), in_8(&iic->sts),
                in_8(&iic->extsts), in_8(&iic->clkdiv), in_8(&iic->xfrcnt),
                in_8(&iic->xtcntlss), in_8(&iic->directcntl));
@@ -663,7 +664,7 @@ static inline u8 iic_clckdiv(unsigned int opb)
 static int __devinit iic_request_irq(struct of_device *ofdev,
                                     struct ibm_iic_private *dev)
 {
-       struct device_node *np = ofdev->node;
+       struct device_node *np = ofdev->dev.of_node;
        int irq;
 
        if (iic_force_poll)
@@ -694,7 +695,7 @@ static int __devinit iic_request_irq(struct of_device *ofdev,
 static int __devinit iic_probe(struct of_device *ofdev,
                               const struct of_device_id *match)
 {
-       struct device_node *np = ofdev->node;
+       struct device_node *np = ofdev->dev.of_node;
        struct ibm_iic_private *dev;
        struct i2c_adapter *adap;
        const u32 *freq;
@@ -756,12 +757,12 @@ static int __devinit iic_probe(struct of_device *ofdev,
                goto error_cleanup;
        }
 
-       /* Now register all the child nodes */
-       of_register_i2c_devices(adap, np);
-
        dev_info(&ofdev->dev, "using %s mode\n",
                 dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)");
 
+       /* Now register all the child nodes */
+       of_register_i2c_devices(adap, np);
+
        return 0;
 
 error_cleanup:
@@ -806,8 +807,11 @@ static const struct of_device_id ibm_iic_match[] = {
 };
 
 static struct of_platform_driver ibm_iic_driver = {
-       .name   = "ibm-iic",
-       .match_table = ibm_iic_match,
+       .driver = {
+               .name = "ibm-iic",
+               .owner = THIS_MODULE,
+               .of_match_table = ibm_iic_match,
+       },
        .probe  = iic_probe,
        .remove = __devexit_p(iic_remove),
 };