From patchwork Thu Dec 12 04:09:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 300504 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 5E9A82C007E for ; Thu, 12 Dec 2013 15:10:39 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751407Ab3LLEJt (ORCPT ); Wed, 11 Dec 2013 23:09:49 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:36900 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086Ab3LLEJr (ORCPT ); Wed, 11 Dec 2013 23:09:47 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id rBC49bkT025634; Wed, 11 Dec 2013 22:09:37 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rBC49atq007152; Wed, 11 Dec 2013 22:09:37 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Wed, 11 Dec 2013 22:09:36 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rBC49aPl015525; Wed, 11 Dec 2013 22:09:36 -0600 From: Felipe Balbi To: CC: , Sebastian Andrzej Siewior , , Linux Kernel Mailing List , Linux OMAP Mailing List , Felipe Balbi Subject: [PATCH 1/2] drivers: net: cpsw: fix dt probe for one port ethernet Date: Wed, 11 Dec 2013 22:09:04 -0600 Message-ID: <1386821345-30555-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.8.4.GIT MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Mugunthan V N When only one port of the two port is pinned out, then dt probe is failing because second port phy is not found. fixing this by checking the number of slaves and breaking the loop. Signed-off-by: Mugunthan V N Signed-off-by: Felipe Balbi --- both patches were taken from TI's 3.12 tree [1] and have been tested on am335x, am437x and dra7xx. Mugunthan, I took the patches because I got bug reports on v3.13-rc which these patches fix. Let me know if you prefer to send another version of them for whatever reason. cheers drivers/net/ethernet/ti/cpsw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 7536a4c..a91f0c9 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1816,6 +1816,8 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, } i++; + if (i == data->slaves) + break; } return 0;