Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp409230rwb; Thu, 22 Sep 2022 01:02:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4pC/RGwbwsVxzUiQHv9eMdAbW1672UuhtFgoN7Fud24GB8zsdwCn98U/Wb6gBhNKl80vpb X-Received: by 2002:a17:907:9712:b0:782:1a73:c7b9 with SMTP id jg18-20020a170907971200b007821a73c7b9mr1677686ejc.629.1663833750565; Thu, 22 Sep 2022 01:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663833750; cv=none; d=google.com; s=arc-20160816; b=XR2EvoshEf2q4vNwIJL45pJfwwvwtADiChKNWcl5uzjSTcsjTQOD9XXepXhS6kWYBY AYpUD6NZxqzFnDPfwhZdpce1365tRr7/KBWjwFVP1NgsLBHHwfOwVqn33obt++KpL7+W pjEN4Kd99HNQoih6qiiOGWoCjvix7eoVhvjwXKLycu0FretQG9lyrY4pC7pg51/RbBfW BrgcWTb/Gc8KeL8KukI8sN6vrNLpNfuWkxav1wlaCYeHIa/mKeK8mdifJHt7LXdRCF9h RpqFyOy4QBu5LTgFc3QjbWb1y5V5eXMmf6NGIzBQhDSZse9dzJXdI8X8NWStwO2u7uN7 X7fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lfcVVmKQPWo0EYvkvndbEaLzkxB8BU/8gU1qupVYwLg=; b=MiSy+JMyqN16G0mIMmp5kVpmC6Sa6IbFKcY6QXa0QIPsKena0IzAUHYpy7tQUk/g/V LTuLMk404igKCvz3WIK5LC6GF80Ku5wtJeNHp2rfD1hAb1j954yhOKn3XyL7Ek//7Jkm mgb6zq/BwBOK/RSww7hOaUN+y9PjTfHATPT9KzGxd1gagb7G93JkJsavRPWbppHDDK4p FJLDjGn3JwZRdOhWfCzH1Wikb9n4B1rbbVWqBoescxsTXw/Nx2RdMWkzSlSGrIs4WKn5 hiWKwcofv2LaCu732qofrHzHs0xxwitxMLikwyW8vFAJxZ2nlBWBpQx1nVNSrDiPlkFR fETA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=qTpPkfMM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d29-20020a50cd5d000000b0044606da79b4si4761426edj.119.2022.09.22.01.01.48; Thu, 22 Sep 2022 01:02:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=qTpPkfMM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230238AbiIVHMz (ORCPT + 99 others); Thu, 22 Sep 2022 03:12:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230352AbiIVHMV (ORCPT ); Thu, 22 Sep 2022 03:12:21 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AAA1B776F; Thu, 22 Sep 2022 00:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1663830729; x=1695366729; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TqSw95am9Kp3Rxvnu/GBt9EmDaerXeLzQ41xHw+Pn4g=; b=qTpPkfMMC5g8uGb2ivfQGtwBH+hTmi5NP22+XnK9jEBOM8NGX3r9qlvC 5CAJhVwnKAV9UW937NGVhRVZjjU00+l+u+sM3xOnd7j59sQ9NA1rIXEQ5 KwNxhlWV9z61GosSPXPZ8Nb5aX5gufT3yQAnzb1PKQEs7+2DTfl1lwoze dQt9d8puBKj7ASoIsSCywhHVQDk9/Yo2+B8U5PddtdK+kSG69bchT96aj vPUlIfPfACMPSff/O81d4SscEe5ksH00HKFpQ7nqcjU/6mzaZyguHGyRu yuLiccNW1nB7+TAxIR/C2yIV6BSsz9BdT9j9RLvmFl/jBKeHq0FuZe1Sg A==; X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="181470958" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Sep 2022 00:12:06 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Thu, 22 Sep 2022 00:12:03 -0700 Received: from CHE-LT-I17769U.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 22 Sep 2022 00:11:57 -0700 From: Arun Ramadoss To: , CC: , , , , , , , , , , , , , , Subject: [Patch net-next v4 3/6] net: dsa: microchip: lan937x: return zero if mdio node not present Date: Thu, 22 Sep 2022 12:40:25 +0530 Message-ID: <20220922071028.18012-4-arun.ramadoss@microchip.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220922071028.18012-1-arun.ramadoss@microchip.com> References: <20220922071028.18012-1-arun.ramadoss@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, if the mdio node is not present in the dts file then lan937x_mdio_register return -ENODEV and entire probing process fails. To make the mdio_register generic for all ksz series switches and to maintain back-compatibility with existing dts file, return -ENODEV is replaced with return 0. Signed-off-by: Arun Ramadoss --- drivers/net/dsa/microchip/lan937x_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c index 2664331cc743..d7382a77d454 100644 --- a/drivers/net/dsa/microchip/lan937x_main.c +++ b/drivers/net/dsa/microchip/lan937x_main.c @@ -214,10 +214,8 @@ static int lan937x_mdio_register(struct ksz_device *dev) int ret; mdio_np = of_get_child_by_name(dev->dev->of_node, "mdio"); - if (!mdio_np) { - dev_err(ds->dev, "no MDIO bus node\n"); - return -ENODEV; - } + if (!mdio_np) + return 0; bus = devm_mdiobus_alloc(ds->dev); if (!bus) { -- 2.36.1