From patchwork Wed Feb 12 15:55:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 319666 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 902932C00A5 for ; Thu, 13 Feb 2014 03:06:40 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753068AbaBLP5B (ORCPT ); Wed, 12 Feb 2014 10:57:01 -0500 Received: from mail-ea0-f177.google.com ([209.85.215.177]:35519 "EHLO mail-ea0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753055AbaBLP46 (ORCPT ); Wed, 12 Feb 2014 10:56:58 -0500 Received: by mail-ea0-f177.google.com with SMTP id m10so1916328eaj.36 for ; Wed, 12 Feb 2014 07:56:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:content-type; bh=nqi4+qcUmCUrWUB+l4GNxV+T4o1xN40447pomXVbj30=; b=R/cUeVIG/SGvFtimta1lovRYS3iC+tOf/2VICFZkEZgLxH/f+uNOPnxBQB9g+lK1yZ Gve0o2rKTYPzjQlLxBDHMAOO5Qh9cMQeb+dYbkWDZYTiZ4gskIGkBsmjSjzV2AE3OCGs DHapYL+bMJOVAvy51VSqywC7AYjZl8n5/KOXSw7ua7EJbhMSsUIxxQmeoeZw2wKi/zyt ZKyEF20fX15SrQTrJXRVpbqY2NWZqS6yCP7b+MeSTDngn3Uv4Myo7E7NeKM8W0UF4xRa cIgYjk+TmBBfkDfNrnzeGH6zKGEQndLmnsMo19htKTivkpT5AmXu5PSdlQFqY6nohFAW 8ftQ== X-Gm-Message-State: ALoCoQm4CRXclkQmi0fW9vEAsEO1AgaQlhto2OGlPoA8WCpekZX51YVEb5gC8d5U06x91bnFw0no X-Received: by 10.15.90.203 with SMTP id q51mr4998233eez.6.1392220617125; Wed, 12 Feb 2014 07:56:57 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id u6sm82602593eep.11.2014.02.12.07.56.54 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 12 Feb 2014 07:56:55 -0800 (PST) From: Michal Simek To: netdev@vger.kernel.org Cc: Srikanth Thokala , Srikanth Thokala , Michal Simek , Anirudha Sarangi , John Linn , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/14] net: axienet: Support phy-less mode of operation Date: Wed, 12 Feb 2014 16:55:41 +0100 Message-Id: <2dce248d6285beb10f3d4fcfba3c3a087e2c139f.1392220536.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Srikanth Thokala This patch adds proper checks to handle the PHY-less case. Signed-off-by: Srikanth Thokala Signed-off-by: Michal Simek --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 1.8.2.3 diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 9595403..9cc9e59 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -940,11 +940,10 @@ static int axienet_open(struct net_device *ndev) PHY_INTERFACE_MODE_RGMII_ID); } - if (!lp->phy_dev) { + if (!lp->phy_dev) dev_err(lp->dev, "of_phy_connect() failed\n"); - return -ENODEV; - } - phy_start(lp->phy_dev); + else + phy_start(lp->phy_dev); } /* Enable tasklets for Axi DMA error handling */ @@ -1609,7 +1608,8 @@ static int axienet_of_probe(struct platform_device *op) lp->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD; lp->phy_node = of_parse_phandle(op->dev.of_node, "phy-handle", 0); - ret = axienet_mdio_setup(lp, op->dev.of_node); + if (lp->phy_node) + ret = axienet_mdio_setup(lp, op->dev.of_node); if (ret) dev_warn(&op->dev, "error registering MDIO bus\n");