Merge remote branch 'origin' into secretlab/next-devicetree
[pandora-kernel.git] / drivers / net / fsl_pq_mdio.c
index 3acac5f..b4c41d7 100644 (file)
@@ -267,7 +267,7 @@ static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
 static int fsl_pq_mdio_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 device_node *tbi;
        struct fsl_pq_mdio_priv *priv;
        struct fsl_pq_mdio __iomem *regs = NULL;
@@ -277,15 +277,17 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev,
        int tbiaddr = -1;
        const u32 *addrp;
        u64 addr = 0, size = 0;
-       int err = 0;
+       int err;
 
        priv = kzalloc(sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
        new_bus = mdiobus_alloc();
-       if (NULL == new_bus)
+       if (!new_bus) {
+               err = -ENOMEM;
                goto err_free_priv;
+       }
 
        new_bus->name = "Freescale PowerQUICC MII Bus",
        new_bus->read = &fsl_pq_mdio_read,
@@ -469,10 +471,13 @@ static struct of_device_id fsl_pq_mdio_match[] = {
 MODULE_DEVICE_TABLE(of, fsl_pq_mdio_match);
 
 static struct of_platform_driver fsl_pq_mdio_driver = {
-       .name = "fsl-pq_mdio",
+       .driver = {
+               .name = "fsl-pq_mdio",
+               .owner = THIS_MODULE,
+               .of_match_table = fsl_pq_mdio_match,
+       },
        .probe = fsl_pq_mdio_probe,
        .remove = fsl_pq_mdio_remove,
-       .match_table = fsl_pq_mdio_match,
 };
 
 int __init fsl_pq_mdio_init(void)