Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp6352681ioo; Thu, 2 Jun 2022 04:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFxIAquzvlSQzG5EMdfwnMIZthLAoQ7PljoV0Y5NXpE/VkJXBhHF/R6TuojWOwabznr7z5 X-Received: by 2002:a17:906:5251:b0:6fe:98cb:d1 with SMTP id y17-20020a170906525100b006fe98cb00d1mr3943000ejm.156.1654170515058; Thu, 02 Jun 2022 04:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654170515; cv=none; d=google.com; s=arc-20160816; b=0S76NZRO4wDHXDuUPwzG/cQxqSlqRgQea2mhBGcda5Ei/CudkXi5Xnh7CJiRq8kuoc 9f7lDY1r0AB2jDj5stuQ7twbCKBTOUgXlFqvNj0Ldd5HORd3KilcQd66eFLe2rcZNkyh PhqbeYH1dGKVgSguPRYMCFp/LdTaqcY0nvQBZ++nOOkUsmdWqGuXRmicRcFSl4cIejVL TiErIr4u/o+VYAXje0NriOHdeHwdXw7l9M4+3mvabeq941rxYa0f9015JVB8se2H5EYo Aswc7Yge7PlJo7xWQlbjiKXTqjAeFcAzkXGsYOmhsr8dbwqORMTfEKsavlZ9vmLJuH5A EO1g== 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=K13Ss91uwNp953S1Qn2a/l7SKkqhzBXyNe1HDSvV5fM=; b=THrFJ16kLLk/UHzqSVZ6I8O2OTHFD5p8BqMrZ1L0d+cn/TjzP4Vx1qSavhmWPu4rH1 9HPDJ3y4Ze9NZPH2qkybW7dHqs4n78tiEAqb5BEDSIUuBQRakqjcQwXOMgpH92fwsajz BRGHIZOdCLFyq2mlNuQks+mnfpgLU7LPD6iqelWA9x5Esqg2v/xeKqw6hlo6SXuC8WYX HuiUiyhgTtYkGHKjXk9gGfCfG9/33j2k4CWBi9LiEMzgJ0taizKtUSIb02zmHbQL1Bf9 tAQD71bzKuqn+U+h4jlsLkV2oZQqzwed2yfpnwE7MMH0yQo5XBo3pvjfuUTcVkWH7ZB6 t7uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Yc5ldH5F; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p17-20020aa7c891000000b0042dcba49d9asi3826131eds.556.2022.06.02.04.48.08; Thu, 02 Jun 2022 04:48:35 -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=@rasmusvillemoes.dk header.s=google header.b=Yc5ldH5F; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231519AbiFBHt3 (ORCPT + 99 others); Thu, 2 Jun 2022 03:49:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231171AbiFBHt1 (ORCPT ); Thu, 2 Jun 2022 03:49:27 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D7E320B7DE for ; Thu, 2 Jun 2022 00:49:25 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id u26so5817181lfd.8 for ; Thu, 02 Jun 2022 00:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K13Ss91uwNp953S1Qn2a/l7SKkqhzBXyNe1HDSvV5fM=; b=Yc5ldH5FA5hc0E+wFlHEiyL25VUeJfBDdSeE2esW+o4HCh9hmSwdz5uaPH5GbVe2bR 5RIxWXfWBbZB7dJkZK3Vkz+9qWrl9l2kZOZQpfj0bHUl9HjQCBIthCNLeFxs/RGCzJpA xy6OI4LxCPuEWItM5/HTOrytYxP0k9B5S0iYY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K13Ss91uwNp953S1Qn2a/l7SKkqhzBXyNe1HDSvV5fM=; b=IvLmCPF522MGW8dPOonSi7y1bJZscpBFUnuSNUkEC/T4/Ig+xm3gpt/l7gO/EjRdZ9 rNE23YZHtHG6nLwAvggLva6xaW5h/DTGTc87z5g6DlJmYggTsVg5mHCDl7anwV6lkSv/ gls7GFNkkMLYae6ZyvXWE1nu+a6lbIgiAtoVRlFMhInKfbXfFW4aliIJI1J07R8oJBky vGeBpEqHwrTgtU7GNRNUoHhJ0Z5b7YzQuWaSZIGcfMDwtXxkT01Ezo3uWEUnqztp5eZO ymZFW1R+5rdVZpio8BcgOYEG+AbgRd4UNY8k6HuvkwxE6AIJuSi5IXEn8tEkf2QCmap2 fsCg== X-Gm-Message-State: AOAM532vM1uoGDSX3BEWhyoV2qIl2u5RIOIpHtv5FbAhlXqlRc3f5r7G oOdrfHYXMQKYE6KYh2nD9Mwxh0wXuwS3+1qY X-Received: by 2002:a05:6512:c1d:b0:478:f321:a57b with SMTP id z29-20020a0565120c1d00b00478f321a57bmr2584044lfu.125.1654156163819; Thu, 02 Jun 2022 00:49:23 -0700 (PDT) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id m16-20020a056512115000b00478f2f2f044sm882946lfg.123.2022.06.02.00.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 00:49:23 -0700 (PDT) From: Rasmus Villemoes To: Giuseppe Cavallaro , Alexandre Torgue Cc: Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Rasmus Villemoes Subject: [PATCH v2] net: stmmac: use dev_err_probe() for reporting mdio bus registration failure Date: Thu, 2 Jun 2022 09:48:40 +0200 Message-Id: <20220602074840.1143360-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220601142226.1123110-1-linux@rasmusvillemoes.dk> References: <20220601142226.1123110-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 I have a board where these two lines are always printed during boot: imx-dwmac 30bf0000.ethernet: Cannot register the MDIO bus imx-dwmac 30bf0000.ethernet: stmmac_dvr_probe: MDIO bus (id: 1) registration failed It's perfectly fine, and the device is successfully (and silently, as far as the console goes) probed later. Use dev_err_probe() instead, which will demote these messages to debug level (thus removing the alarming messages from the console) when the error is -EPROBE_DEFER, and also has the advantage of including the error code if/when it happens to be something other than -EPROBE_DEFER. While here, add the missing \n to one of the format strings. Signed-off-by: Rasmus Villemoes --- v2: Reindent following lines, fix spello in commit message, also add \n. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 3b81d4e9dc83..d1a7cf4567bc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7129,9 +7129,9 @@ int stmmac_dvr_probe(struct device *device, /* MDIO bus Registration */ ret = stmmac_mdio_register(ndev); if (ret < 0) { - dev_err(priv->device, - "%s: MDIO bus (id: %d) registration failed", - __func__, priv->plat->bus_id); + dev_err_probe(priv->device, ret, + "%s: MDIO bus (id: %d) registration failed\n", + __func__, priv->plat->bus_id); goto error_mdio_register; } } diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index 9bc625fccca0..03d3d1f7aa4b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -482,7 +482,7 @@ int stmmac_mdio_register(struct net_device *ndev) err = of_mdiobus_register(new_bus, mdio_node); if (err != 0) { - dev_err(dev, "Cannot register the MDIO bus\n"); + dev_err_probe(dev, err, "Cannot register the MDIO bus\n"); goto bus_register_fail; } -- 2.31.1