Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp191895lqp; Mon, 10 Jun 2024 00:19:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxbvf6itM+Hr2xZkMW7i1r9GSxQN0RH0aq9wCYGzeMJS1cSW0VFDHhy5XvzS+wpUkWrvm0guzQAVWnyxR5MlTF1OYUgW8dPyWPNIet6g== X-Google-Smtp-Source: AGHT+IFuF0TRJY52t4Bk0U5nZb3n7ljuxCE8skd5ws3qk2bJhGw1wq+Ok7G2tTtjCL/Shbv18Sly X-Received: by 2002:a17:906:32c7:b0:a68:a137:d041 with SMTP id a640c23a62f3a-a6cd5611ba8mr556704066b.12.1718003974382; Mon, 10 Jun 2024 00:19:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718003974; cv=pass; d=google.com; s=arc-20160816; b=yQS9PikBMJbTgWaoEWJhN5UWOVUSqFMNtEbciFhbJJsix91iP2XdcQ88Ei4oYGCNHA WWN1XCu/VqZxx608BoXF+oYsRH5Kzo6vsQMQWwaAtgqcVyRFdkQfabFpNHuOK9Kdw3Fb 4snowsueLXoGjhnddo4JmKeOEOuB3A4dlMW1xlHg/58QBAi3OHeehBYmdLb6yMwlle42 RcQgKKg/L3rt/hG4KZMDqt6x6CoyLAvXW18btKTtzTJrNkhxzE/3Q44k2n8V412vVFlB WAEdL3EYDjNly8QbwOObxltrQhjUJ+2ropD3xvHStnAdsDgbmpkLA1qrkWRWFM7PTmkh kNmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=oZt3ANozAyCi4RMnooDgV1ukrsEF0MYMZVmMcPQZSJw=; fh=PNVS6hneBIB5DuUKcqXTZxY2dQy/qm89zdYDxH+oLxc=; b=pP1eN3Zl5z5APhCN1zw2s2QEqZJtF+zwZsEBbWSzmsRfuhOJSadgkEThA4EsXaDw/2 gtHQRBg4nA/Xj9FHXNNP20+XzuXfUIy4219jJpJ783o2aNLcieUFon6BkLL9Fx+K7sLk E6+RTBs2Q40SfIgY1N+nxZn1dGdmuvavbFgJ4eEQI2zUUxF2MPaxrbaeJM02WPJ8QNWu NvfHq3AmNzkQ3YOVjbbivDb0CQKwdzerg/ETFbAIp/l1/GlI3wN5yomGz+goMhug7AbY 3OJgPvAd7+Fpxdeg/pogAjUBBbG/ijO4eParLkxDSJ2BlNvy2VMrdgFmxMOep4Kw1Xdm DRlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=zQhgM00i; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-207762-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207762-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f11e420basi159772266b.90.2024.06.10.00.19.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 00:19:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207762-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=zQhgM00i; arc=pass (i=1 spf=pass spfdomain=foss.st.com dkim=pass dkdomain=foss.st.com dmarc=pass fromdomain=foss.st.com); spf=pass (google.com: domain of linux-kernel+bounces-207762-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207762-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E8B9E1F21006 for ; Mon, 10 Jun 2024 07:19:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 946951CD24; Mon, 10 Jun 2024 07:18:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b="zQhgM00i" 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 smtp.subspace.kernel.org (Postfix) with ESMTPS id E451620DC4; Mon, 10 Jun 2024 07:18:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.207.212.93 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718003893; cv=none; b=p/sFx4NMYJFFbhDXkFyQ/Gl++PZmFtL97WBNUodhqIjMJ72dZxWdawmlGVFFwxjKBZ/DM4/yJdYBkalIaHQZwa+nXSuD6iF2PDkqUCHi+4TidkfZOB6GKtjXPVm3d4iVA4BTINVLjxL3c+aA575CvaaiRgJfnpo6HVoGKJ0tWRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718003893; c=relaxed/simple; bh=Wz7+F3RX2ErVq2AoH1Oy/dBnTV8neAuhbUlnFn1Nr6k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=D1ZxFfYnbDLSRpGMs0/hiYJEmzm1MAkHkUN90soJofSJX2CT1XNvRI4hmY75yJSZ1ikeBW56jRSSHfEmzz5lHPDCI+BecqhWKpQSHyQ0+ieJwP61yTa5fxVOD2peirz0/AvlgteyD26GrJU4NzDi/cgunvfusaEusMQBvIcWlqk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com; spf=pass smtp.mailfrom=foss.st.com; dkim=pass (2048-bit key) header.d=foss.st.com header.i=@foss.st.com header.b=zQhgM00i; arc=none smtp.client-ip=91.207.212.93 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 459LZn11007322; Mon, 10 Jun 2024 09:17:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=selector1; bh= oZt3ANozAyCi4RMnooDgV1ukrsEF0MYMZVmMcPQZSJw=; b=zQhgM00i3nMdeKvn SN+6Vzfx6jTDT51aB3O7svnng5KdHIvVNHq1zUI36fbj6l1wCsfkBUxuSgXQiRkV FPOKVJJGjRtpBCf7W9EY3M4e5VZeRtPmmyYyduYund+wdUTtgKojrCD1BOtII3TL m9LG+aI1Ev+y5Hq3VpknUVMUYFuSHaLsrlBNI6HioED+TYjxPBJwYz5sE4IrUqc2 bv3qxi04KRvX+ovMlQhDfXdK0Wke9BT4jOTbT3UU5BcScaPofBe3ZyVLBkpFn6gT iJuenMqL/px1LOUMEKqR85gTuAZcpdrCIifQ5T7wZTfpe4xn185cBsP8vWCN2Lts sOJbnw== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3ymce5nk96-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jun 2024 09:17:49 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 90F1940046; Mon, 10 Jun 2024 09:17:45 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BAC5B20E66B; Mon, 10 Jun 2024 09:16:31 +0200 (CEST) Received: from localhost (10.48.86.164) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 10 Jun 2024 09:16:31 +0200 From: Christophe Roullier To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Jose Abreu , Liam Girdwood , Mark Brown , Christophe Roullier , Marek Vasut CC: , , , , Subject: [net-next,PATCH v6 5/8] net: stmmac: dwmac-stm32: Clean up the debug prints Date: Mon, 10 Jun 2024 09:14:56 +0200 Message-ID: <20240610071459.287500-6-christophe.roullier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240610071459.287500-1-christophe.roullier@foss.st.com> References: <20240610071459.287500-1-christophe.roullier@foss.st.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-10_02,2024-06-06_02,2024-05-17_01 From: Marek Vasut Use dev_err()/dev_dbg() and phy_modes() to print PHY mode instead of pr_debug() and hand-written PHY mode decoding. This way, each debug print has associated device with it and duplicated mode decoding is removed. Signed-off-by: Marek Vasut Signed-off-by: Christophe Roullier --- .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c index aa413edd1ef71..75981ac2cbb56 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c @@ -228,19 +228,16 @@ static int stm32mp1_configure_pmcr(struct plat_stmmacenet_data *plat_dat) switch (plat_dat->mac_interface) { case PHY_INTERFACE_MODE_MII: val = SYSCFG_PMCR_ETH_SEL_MII; - pr_debug("SYSCFG init : PHY_INTERFACE_MODE_MII\n"); break; case PHY_INTERFACE_MODE_GMII: val = SYSCFG_PMCR_ETH_SEL_GMII; if (dwmac->enable_eth_ck) val |= SYSCFG_PMCR_ETH_CLK_SEL; - pr_debug("SYSCFG init : PHY_INTERFACE_MODE_GMII\n"); break; case PHY_INTERFACE_MODE_RMII: val = SYSCFG_PMCR_ETH_SEL_RMII; if (dwmac->enable_eth_ck) val |= SYSCFG_PMCR_ETH_REF_CLK_SEL; - pr_debug("SYSCFG init : PHY_INTERFACE_MODE_RMII\n"); break; case PHY_INTERFACE_MODE_RGMII: case PHY_INTERFACE_MODE_RGMII_ID: @@ -249,15 +246,16 @@ static int stm32mp1_configure_pmcr(struct plat_stmmacenet_data *plat_dat) val = SYSCFG_PMCR_ETH_SEL_RGMII; if (dwmac->enable_eth_ck) val |= SYSCFG_PMCR_ETH_CLK_SEL; - pr_debug("SYSCFG init : PHY_INTERFACE_MODE_RGMII\n"); break; default: - pr_debug("SYSCFG init : Do not manage %d interface\n", - plat_dat->mac_interface); + dev_err(dwmac->dev, "Mode %s not supported", + phy_modes(plat_dat->mac_interface)); /* Do not manage others interfaces */ return -EINVAL; } + dev_dbg(dwmac->dev, "Mode %s", phy_modes(plat_dat->mac_interface)); + /* Need to update PMCCLRR (clear register) */ regmap_write(dwmac->regmap, reg + SYSCFG_PMCCLRR_OFFSET, dwmac->ops->syscfg_eth_mask); @@ -291,19 +289,19 @@ static int stm32mcu_set_mode(struct plat_stmmacenet_data *plat_dat) switch (plat_dat->mac_interface) { case PHY_INTERFACE_MODE_MII: val = SYSCFG_MCU_ETH_SEL_MII; - pr_debug("SYSCFG init : PHY_INTERFACE_MODE_MII\n"); break; case PHY_INTERFACE_MODE_RMII: val = SYSCFG_MCU_ETH_SEL_RMII; - pr_debug("SYSCFG init : PHY_INTERFACE_MODE_RMII\n"); break; default: - pr_debug("SYSCFG init : Do not manage %d interface\n", - plat_dat->mac_interface); + dev_err(dwmac->dev, "Mode %s not supported", + phy_modes(plat_dat->mac_interface)); /* Do not manage others interfaces */ return -EINVAL; } + dev_dbg(dwmac->dev, "Mode %s", phy_modes(plat_dat->mac_interface)); + return regmap_update_bits(dwmac->regmap, reg, dwmac->ops->syscfg_eth_mask, val << 23); } -- 2.25.1