From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F083DC4727D for ; Fri, 25 Sep 2020 14:44:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C070B22B2D for ; Fri, 25 Sep 2020 14:44:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729115AbgIYOon (ORCPT ); Fri, 25 Sep 2020 10:44:43 -0400 Received: from inva021.nxp.com ([92.121.34.21]:46768 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728731AbgIYOok (ORCPT ); Fri, 25 Sep 2020 10:44:40 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 994202005EE; Fri, 25 Sep 2020 16:44:38 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8D731200604; Fri, 25 Sep 2020 16:44:38 +0200 (CEST) Received: from fsr-ub1864-126.ea.freescale.net (fsr-ub1864-126.ea.freescale.net [10.171.82.212]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 588E32030E; Fri, 25 Sep 2020 16:44:38 +0200 (CEST) From: Ioana Ciornei To: davem@davemloft.net, netdev@vger.kernel.org Cc: Ioana Ciornei Subject: [PATCH net-next 1/3] dpaa2-mac: do not check for both child and parent DTS nodes Date: Fri, 25 Sep 2020 17:44:19 +0300 Message-Id: <20200925144421.7811-2-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200925144421.7811-1-ioana.ciornei@nxp.com> References: <20200925144421.7811-1-ioana.ciornei@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There is no need to check if both the MDIO controller node and its child node, the PCS device, are available since there is no chance that the child node would be enabled when the parent it's not. Suggested-by: Andrew Lunn Signed-off-by: Ioana Ciornei --- drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c index 6ff64dd1cf27..cdd1acd0117e 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c @@ -267,8 +267,7 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac, return 0; } - if (!of_device_is_available(node) || - !of_device_is_available(node->parent)) { + if (!of_device_is_available(node)) { netdev_err(mac->net_dev, "pcs-handle node not available\n"); return -ENODEV; } -- 2.25.1