[PATCH] net/fs_enet: Allow use_rmii to be set in OF

Ken MacLeod ken at bitsko.slc.ut.us
Sat Jun 13 07:34:37 EST 2009


Allow use_rmii in fs_platform_info to be set in the OF device tree
using phy-mode="rmii".

Signed-off-by: Ken MacLeod <ken at bitsko.slc.ut.us>
---
 drivers/net/fs_enet/fs_enet-main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index a9cbc31..57879be 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -1043,6 +1043,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
 	struct fs_platform_info *fpi;
 	const u32 *data;
 	const u8 *mac_addr;
+	const char *str;
 	int privsize, len, ret = -ENODEV;
 
 	fpi = kzalloc(sizeof(*fpi), GFP_KERNEL);
@@ -1057,6 +1058,10 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
 		fpi->cp_command = *data;
 	}
 
+	str = of_get_property(ofdev->node, "phy-mode", &len);
+	if (str != NULL && !strcasecmp(str, "rmii"))
+		fpi->use_rmii = 1;
+
 	fpi->rx_ring = 32;
 	fpi->tx_ring = 32;
 	fpi->rx_copybreak = 240;
-- 
1.5.4.3


More information about the Linuxppc-dev mailing list