From patchwork Thu Feb 16 03:54:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 141481 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 563521007D4 for ; Thu, 16 Feb 2012 14:55:05 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752109Ab2BPDzA (ORCPT ); Wed, 15 Feb 2012 22:55:00 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:57939 "EHLO relmlor4.renesas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995Ab2BPDy6 (ORCPT ); Wed, 15 Feb 2012 22:54:58 -0500 Received: from relmlir2.idc.renesas.com ([10.200.68.152]) by relmlor4.idc.renesas.com ( SJSMS) with ESMTP id <0LZG00M5DW7K0E40@relmlor4.idc.renesas.com> for netdev@vger.kernel.org; Thu, 16 Feb 2012 12:54:56 +0900 (JST) Received: from relmlac2.idc.renesas.com ([10.200.69.22]) by relmlir2.idc.renesas.com ( SJSMS) with ESMTP id <0LZG00905W7K3S10@relmlir2.idc.renesas.com> for netdev@vger.kernel.org; Thu, 16 Feb 2012 12:54:56 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 84495280A3; Thu, 16 Feb 2012 12:54:56 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 7EA31280A2; Thu, 16 Feb 2012 12:54:56 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac2.idc.renesas.com with ESMTP id NAE12063; Thu, 16 Feb 2012 12:54:56 +0900 X-IronPort-AV: E=Sophos; i="4.73,426,1325430000"; d="scan'208"; a="68273398" Received: from unknown (HELO [172.30.8.157]) ([172.30.8.157]) by relmlii1.idc.renesas.com with ESMTP; Thu, 16 Feb 2012 12:54:56 +0900 Message-id: <4F3C7E10.3060905@renesas.com> Date: Thu, 16 Feb 2012 12:54:56 +0900 From: "Shimoda, Yoshihiro" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1 MIME-version: 1.0 To: netdev Cc: Nobuhiro Iwamatsu Subject: [PATCH net-next 2/5] net: sh_eth: change the condition of initialization Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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. Signed-off-by: Yoshihiro Shimoda --- drivers/net/ethernet/renesas/sh_eth.c | 4 ++-- include/linux/sh_eth.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 8f53b5a..5a5afbc 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -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); diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h index 2076acf..b17d765 100644 --- a/include/linux/sh_eth.h +++ b/include/linux/sh_eth.h @@ -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