Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161069AbbEEJ3w (ORCPT ); Tue, 5 May 2015 05:29:52 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:38538 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031432AbbEEJ0Y (ORCPT ); Tue, 5 May 2015 05:26:24 -0400 From: Michal Simek To: netdev@vger.kernel.org Cc: Srikanth Thokala , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , monstr@monstr.eu, John Linn , Anirudha Sarangi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/12] net: axienet: Support phy-less mode of operation Date: Tue, 5 May 2015 11:25:58 +0200 Message-Id: <9f96915ea98cb99b9c437930e08c27d5a00e465e.1430817941.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <7fb84f65a61bbe0fdb4b61a871cf4d4f7910955d.1430817941.git.michal.simek@xilinx.com> References: <7fb84f65a61bbe0fdb4b61a871cf4d4f7910955d.1430817941.git.michal.simek@xilinx.com> In-Reply-To: <7fb84f65a61bbe0fdb4b61a871cf4d4f7910955d.1430817941.git.michal.simek@xilinx.com> References: <7fb84f65a61bbe0fdb4b61a871cf4d4f7910955d.1430817941.git.michal.simek@xilinx.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1613 Lines: 48 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(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index b1081e1893b0..c6f2ba056c26 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 */ @@ -1606,7 +1605,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"); -- 2.3.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/