]> err.no Git - linux-2.6/commitdiff
fs_enet: Add fixed-phy support for fs_enet
authorJochen Friedrich <jochen@scram.de>
Tue, 18 Dec 2007 15:25:43 +0000 (16:25 +0100)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 24 Jan 2008 01:54:28 +0000 (19:54 -0600)
This patch adds support to use the fixed-link property of an ethernet node
to fs_enet for the CONFIG_PPC_CPM_NEW_BINDING case.

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Jeff Garzik <jeff@garzik.org>
Acked-by: Vitali Bordug <vitb@kernel.crashing.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
drivers/net/fs_enet/fs_enet-main.c

index f2a4d399a6e5137f63fab69a52677317d6d7c9c9..8220c70534ed7dbb7e6393d53c4ba4ac484b0ee4 100644 (file)
@@ -1174,8 +1174,15 @@ static int __devinit find_phy(struct device_node *np,
        struct device_node *phynode, *mdionode;
        struct resource res;
        int ret = 0, len;
+       const u32 *data;
+
+       data  = of_get_property(np, "fixed-link", NULL);
+       if (data) {
+               snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data);
+               return 0;
+       }
 
-       const u32 *data = of_get_property(np, "phy-handle", &len);
+       data = of_get_property(np, "phy-handle", &len);
        if (!data || len != 4)
                return -EINVAL;