Skip to contentSkip to conversation

net: sh_eth: change the condition of initialization

PATCH Applied Shimoda, Yoshihiro 2 participants 2 messages Feb 16, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/5 net: sh_eth: change the condition of initialization

The SH7757 has 2 Fast Ethernet and 2 Gigabit Ethernet, and the first Gigabit channel needs the initialization. So, this patch adds the parameter of "needs_init", and if the sh_eth_plat_data is set it to 1, the driver will initialize the channel.

---
 drivers/net/ethernet/renesas/sh_eth.c |    4 ++--
 include/linux/sh_eth.h                |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/renesas/sh_eth.c +2 -2
index 8f53b5a..5a5afbc 100644
@@ -1859,8 +1859,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
 	/* read and set MAC address */
 	read_mac_address(ndev, pd->mac_addr);
 
-	/* First device only init */
-	if (!devno) {
+	/* initialize first or needed device */
+	if (!devno || pd->needs_init) {
 		if (mdp->cd->tsu) {
 			struct resource *rtsu;
 			rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
include/linux/sh_eth.h +1 -0
index 2076acf..b17d765 100644
@@ -20,6 +20,7 @@ struct sh_eth_plat_data {
 	unsigned char mac_addr[6];
 	unsigned no_ether_link:1;
 	unsigned ether_link_active_low:1;
+	unsigned needs_init:1;
 };
 
 #endif
Signature · 1 line
1.7.1
maintainer Applied
#1 lore raw

From: "Shimoda, Yoshihiro" <[email protected]>
Date: Thu, 16 Feb 2012 12:54:56 +0900

Quoted 6 lines

The SH7757 has 2 Fast Ethernet and 2 Gigabit Ethernet, and the first Gigabit channel needs the initialization. So, this patch adds the parameter of "needs_init", and if the sh_eth_plat_data is set it to 1, the driver will initialize the channel.

Applied.