}
 }
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id xgene_enet_acpi_match[] = {
+       { "APMC0D05", XGENE_ENET1},
+       { "APMC0D30", XGENE_ENET1},
+       { "APMC0D31", XGENE_ENET1},
+       { "APMC0D3F", XGENE_ENET1},
+       { "APMC0D26", XGENE_ENET2},
+       { "APMC0D25", XGENE_ENET2},
+       { }
+};
+MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match);
+#endif
+
+static const struct of_device_id xgene_enet_of_match[] = {
+       {.compatible = "apm,xgene-enet",    .data = (void *)XGENE_ENET1},
+       {.compatible = "apm,xgene1-sgenet", .data = (void *)XGENE_ENET1},
+       {.compatible = "apm,xgene1-xgenet", .data = (void *)XGENE_ENET1},
+       {.compatible = "apm,xgene2-sgenet", .data = (void *)XGENE_ENET2},
+       {.compatible = "apm,xgene2-xgenet", .data = (void *)XGENE_ENET2},
+       {},
+};
+
+MODULE_DEVICE_TABLE(of, xgene_enet_of_match);
+
 static int xgene_enet_probe(struct platform_device *pdev)
 {
        struct net_device *ndev;
        xgene_enet_remove(pdev);
 }
 
-#ifdef CONFIG_ACPI
-static const struct acpi_device_id xgene_enet_acpi_match[] = {
-       { "APMC0D05", XGENE_ENET1},
-       { "APMC0D30", XGENE_ENET1},
-       { "APMC0D31", XGENE_ENET1},
-       { "APMC0D3F", XGENE_ENET1},
-       { "APMC0D26", XGENE_ENET2},
-       { "APMC0D25", XGENE_ENET2},
-       { }
-};
-MODULE_DEVICE_TABLE(acpi, xgene_enet_acpi_match);
-#endif
-
-#ifdef CONFIG_OF
-static const struct of_device_id xgene_enet_of_match[] = {
-       {.compatible = "apm,xgene-enet",    .data = (void *)XGENE_ENET1},
-       {.compatible = "apm,xgene1-sgenet", .data = (void *)XGENE_ENET1},
-       {.compatible = "apm,xgene1-xgenet", .data = (void *)XGENE_ENET1},
-       {.compatible = "apm,xgene2-sgenet", .data = (void *)XGENE_ENET2},
-       {.compatible = "apm,xgene2-xgenet", .data = (void *)XGENE_ENET2},
-       {},
-};
-
-MODULE_DEVICE_TABLE(of, xgene_enet_of_match);
-#endif
-
 static struct platform_driver xgene_enet_driver = {
        .driver = {
                   .name = "xgene-enet",
 
 }
 #endif
 
+static const struct of_device_id xgene_mdio_of_match[] = {
+       {
+               .compatible = "apm,xgene-mdio-rgmii",
+               .data = (void *)XGENE_MDIO_RGMII
+       },
+       {
+               .compatible = "apm,xgene-mdio-xfi",
+               .data = (void *)XGENE_MDIO_XFI
+       },
+       {},
+};
+MODULE_DEVICE_TABLE(of, xgene_mdio_of_match);
+
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id xgene_mdio_acpi_match[] = {
+       { "APMC0D65", XGENE_MDIO_RGMII },
+       { "APMC0D66", XGENE_MDIO_XFI },
+       { }
+};
+
+MODULE_DEVICE_TABLE(acpi, xgene_mdio_acpi_match);
+#endif
+
+
 static int xgene_mdio_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        return 0;
 }
 
-#ifdef CONFIG_OF
-static const struct of_device_id xgene_mdio_of_match[] = {
-       {
-               .compatible = "apm,xgene-mdio-rgmii",
-               .data = (void *)XGENE_MDIO_RGMII
-       },
-       {
-               .compatible = "apm,xgene-mdio-xfi",
-               .data = (void *)XGENE_MDIO_XFI
-       },
-       {},
-};
-
-MODULE_DEVICE_TABLE(of, xgene_mdio_of_match);
-#endif
-
-#ifdef CONFIG_ACPI
-static const struct acpi_device_id xgene_mdio_acpi_match[] = {
-       { "APMC0D65", XGENE_MDIO_RGMII },
-       { "APMC0D66", XGENE_MDIO_XFI },
-       { }
-};
-
-MODULE_DEVICE_TABLE(acpi, xgene_mdio_acpi_match);
-#endif
-
 static struct platform_driver xgene_mdio_driver = {
        .driver = {
                .name = "xgene-mdio",
 
 #define GET_BIT(field, src) \
                xgene_enet_get_field_value(field ## _POS, 1, src)
 
-static const struct of_device_id xgene_mdio_of_match[];
-#ifdef CONFIG_ACPI
-static const struct acpi_device_id xgene_mdio_acpi_match[];
-#endif
 int xgene_mdio_rgmii_read(struct mii_bus *bus, int phy_id, int reg);
 int xgene_mdio_rgmii_write(struct mii_bus *bus, int phy_id, int reg, u16 data);
 struct phy_device *xgene_enet_phy_register(struct mii_bus *bus, int phy_addr);