From patchwork Tue Jul 20 18:09:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick DELAUNAY X-Patchwork-Id: 1507709 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.a=rsa-sha256 header.s=selector1 header.b=CcEnq3T+; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GTmxR0bMDz9s5R for ; Wed, 21 Jul 2021 04:11:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2089182CDD; Tue, 20 Jul 2021 20:11:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foss.st.com header.i=@foss.st.com header.b="CcEnq3T+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2F55482D9B; Tue, 20 Jul 2021 20:10:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E144B82D83 for ; Tue, 20 Jul 2021 20:10:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=18357c6fa2=patrick.delaunay@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16KI2whX013097; Tue, 20 Jul 2021 20:10:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=dXoDI5rBp7XfB90qyZVpwPmlWd4Jq+j7eRW5T9Eud/0=; b=CcEnq3T+uLDrCMt/G2kLMPiingKQsFW6eRWV0a5x2G/WFSGdwYdwg6M6MpJvUzQmjc3n jtpqMr2EPJpjCpgE5hZ55R/wuWEPKS7X10omyE1aa4l2UHI8rI24S32BOsuZpWOUMw6D bvYLV9d+uPRzzfSq07niXGIREI51UPkHx2clzfDes3DucS2/myK95j5fF8iueWIMG0f+ nwbwl+sN8njMPvrjrW13iXR+EzqAGLpUDCgEqGG9f0m7GOLUL5kM74g7srdyugKe6Dk/ f/Sjs30H9Ai9iXbeXariJoCiG5u85lURPSr4c91fQDH/leb+FtLwabSgvQyqbx2ao0Eb Uw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 39wtu2k581-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Jul 2021 20:10:42 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 60FC1100034; Tue, 20 Jul 2021 20:10:42 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5506F2C4217; Tue, 20 Jul 2021 20:10:42 +0200 (CEST) Received: from localhost (10.75.127.48) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 20 Jul 2021 20:10:41 +0200 From: Patrick Delaunay To: CC: Christophe Roullier , Marek Vasut , Patrick Delaunay , Ramon Fried , Joe Hershberger , U-Boot STM32 Subject: [PATCH v3 2/6] net: eth-phy: use dev_dbg and log_notice Date: Tue, 20 Jul 2021 20:09:52 +0200 Message-ID: <20210720200940.v3.2.I523f439458f0ff2d770a2b8e8a7c8e0969e783dd@changeid> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210720180957.2948197-1-patrick.delaunay@foss.st.com> References: <20210720180957.2948197-1-patrick.delaunay@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG2NODE1.st.com (10.75.127.4) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-20_12:2021-07-19, 2021-07-20 signatures=0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Replace debug trace and printf to log macros: - debug() replaced by dev_dbg() when device is available, this macro indicate the device name since commit ceb70bb870ac ("dm: Print device name in dev_xxx like Linux") - printf() replaced by log_notice() to allow dispatch to log backends. Reviewed-by: Ramon Fried Signed-off-by: Patrick Delaunay --- (no changes since v2) Changes in v2: - use log macro in eth-phy driver (NEW) drivers/net/eth-phy-uclass.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c index 7abed14392..aa5b05abc8 100644 --- a/drivers/net/eth-phy-uclass.c +++ b/drivers/net/eth-phy-uclass.c @@ -5,8 +5,10 @@ #include #include +#include #include #include +#include #include #include #include @@ -27,25 +29,25 @@ int eth_phy_binds_nodes(struct udevice *eth_dev) mdio_node = dev_read_subnode(eth_dev, "mdio"); if (!ofnode_valid(mdio_node)) { - debug("%s: %s mdio subnode not found!", __func__, - eth_dev->name); + dev_dbg(eth_dev, "%s: %s mdio subnode not found!", __func__, + eth_dev->name); return -ENXIO; } ofnode_for_each_subnode(phy_node, mdio_node) { node_name = ofnode_get_name(phy_node); - debug("* Found child node: '%s'\n", node_name); + dev_dbg(eth_dev, "* Found child node: '%s'\n", node_name); ret = device_bind_driver_to_node(eth_dev, "eth_phy_generic_drv", node_name, phy_node, NULL); if (ret) { - debug(" - Eth phy binding error: %d\n", ret); + dev_dbg(eth_dev, " - Eth phy binding error: %d\n", ret); continue; } - debug(" - bound phy device: '%s'\n", node_name); + dev_dbg(eth_dev, " - bound phy device: '%s'\n", node_name); } return 0; @@ -86,14 +88,14 @@ struct mii_dev *eth_phy_get_mdio_bus(struct udevice *eth_dev) */ uc_priv = (struct eth_phy_device_priv *)(dev_get_uclass_priv(phy_dev)); if (uc_priv->mdio_bus) - printf("Get shared mii bus on %s\n", eth_dev->name); + log_notice("Get shared mii bus on %s\n", eth_dev->name); else - printf("Can't get shared mii bus on %s\n", eth_dev->name); + log_notice("Can't get shared mii bus on %s\n", eth_dev->name); return uc_priv->mdio_bus; } } else { - printf("FEC: can't find phy-handle\n"); + log_notice("FEC: can't find phy-handle\n"); } return NULL; @@ -106,7 +108,7 @@ int eth_phy_get_addr(struct udevice *dev) if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, &phandle_args)) { - debug("Failed to find phy-handle"); + dev_dbg(dev, "Failed to find phy-handle"); return -ENODEV; }