Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp2036811lqp; Tue, 16 Apr 2024 05:54:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8e9MwI9RKwwnHSFr8CVp1978NpPwfPjZ6KU/NbvuJbKhmD09nEiyzlv9JIN1i7pDCHVf3YOkh5glwnGeYWxw648f8tvNKgz0Dv7vYVw== X-Google-Smtp-Source: AGHT+IEsNEtAyIg0Iq84pueGywpIUn5dLGVe/p5vXYJCYv4omSqGYdxqxAO+UZdIOlweqJmW2ZNl X-Received: by 2002:a05:6e02:1a29:b0:36a:fe5f:732a with SMTP id g9-20020a056e021a2900b0036afe5f732amr14999786ile.24.1713272042404; Tue, 16 Apr 2024 05:54:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713272042; cv=pass; d=google.com; s=arc-20160816; b=AXsToOPrngCVR0osjnX2BS+u6sWiI1St9tFRkz2KXaVXdxmnnQXl7Gf7Js8KRi/VDq KbvbMxuJP0rvqHVOsSGLeXSglPaRd/bg3VJrsol404n4HzFo/CTlOx5ThFd5Q+N780rs NiSg4b2CyJD/fmLGJ6iyIC3Ug4lWC/NULtDwjoRIH+MICW1FrSiwqTqbjCaiQy3j0Uie XShuLbcIM7Q/pt0b9aHOswvocBOdnM/AhK3deC7gJMwe2cMcqrx5btS5DAx7fjkFMD7o FW0rxqmOQE3+yIPtNgoHx3Y1drT3ieS9v8wGkm1R8xE1pCbHrsdpEOIWQUFLvrOwWFD9 uHhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=9MU9XELe1rM5Qiqxbtkg8dW/yfnlPXWOR1yK6MM7gxg=; fh=GkNdvG04Lunqqv1Jt68/BI66vXiv28hSSvpkD3jAO7w=; b=YXiuQYpX91xrbh0nXa+mZrHkeB+umRzwyGMod7Xj0eaZebe4jDw18t7LAuMA8ITGH9 ZCWv7dtY/3bpH76NTMfNSj6jw1w3UTmkpsDnk0oOhULpaKjXtrXwzbW38uTxGHZJEgKT Z+eFeJxfWrIuK1747F0Tf6wVnYUVJAvJnhmJy3/P+yUSrUnU1wtv2cK7rF0XpyHa6fwb rQYDVzxqbtuCB+pffUV+su4MYlx/QDkOq6F5cgmIZ7whFYacLlASOKIUvhngjhHiZ47f UHis/kGBAh7rwIimHJamjgCflJha0fH329YIke/iPaVwJoxkn50MWOz5Bd9v/Z6Swvap 0adQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WLbBzn5g; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-146822-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146822-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c14-20020a63d50e000000b005d59eb08d15si10022559pgg.383.2024.04.16.05.54.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 05:54:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146822-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WLbBzn5g; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-146822-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146822-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7E257B2288E for ; Tue, 16 Apr 2024 12:53:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 727ED12C46C; Tue, 16 Apr 2024 12:53:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="WLbBzn5g" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (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 629B112BE8C for ; Tue, 16 Apr 2024 12:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713271982; cv=none; b=Co52uTyk8UxL1qKow1D3aUdK4Lr9A5btxRyhu0kbBPxrPF+oY7FTyeGGzMBS6lKOggBzkV4j1gXPZYs61ZL7e2G02vLB8pCsUCfbE+TpR6g0sDgs+M+ul1T29Up2hVPlNh9dL0sv9eI3/Ykv2cORw10dUFLfWkbKPHllM68ckW0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713271982; c=relaxed/simple; bh=gDGwcPUlhrJ58tTxtAf4S10aFgybKlZmlLgO5JE33HE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AIkvclCzGHMjmte9LdYr32EZknBD8sn4kgsz5pWVSCKaywPb+vZylHkYzq8OQdonCTPQJMU6NBxwVfOGjxW1H7ZGPGFlnHHHNsqUNxABBBnambw+VgC6v5UtQwN6y2pNpM0k5rRIb0TSfHvHmLhZfFkjjt9cSS06AjCH67I5Koc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=WLbBzn5g; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 26AC020009; Tue, 16 Apr 2024 12:52:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713271973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9MU9XELe1rM5Qiqxbtkg8dW/yfnlPXWOR1yK6MM7gxg=; b=WLbBzn5gy3ph07VsIR980IaL+R79W7fITyjAVQdORLdCv59T3lKm2bJ//bK+PZLVmHSuU4 3bybP5lxjM52va46BJHwEI1GW8jaxeKX7+5fY/2XQgS/3qN8TbJlNfy3K43HM4q0t3/fzk EVZn9UMeKFnxAk/NjWQ9IgDvT0ppobvVOQIa23gLu08aW2nyoeR0zqOFtNAxPaIhxtGvWy IVAu6QhHDfpQF2qQq6w4FeCL8W/mpvBJbRiIiLtylHfxj10FcEcNQ9BK2UvPT7QqHXt95r kVIeex45iiRJd6lL43bwUUyGbZnbAATIq4BwWmNM41qlrjQTukj2O2mag8Z9CA== From: Thomas Richard Date: Tue, 16 Apr 2024 14:52:30 +0200 Subject: [PATCH 1/8] phy: ti: phy-j721e-wiz: use dev_err_probe() instead of dev_err() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240412-j7200-phy-s2r-v1-1-f15815833974@bootlin.com> References: <20240412-j7200-phy-s2r-v1-0-f15815833974@bootlin.com> In-Reply-To: <20240412-j7200-phy-s2r-v1-0-f15815833974@bootlin.com> To: Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com, Thomas Richard X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com Use dev_err_probe() instead of dev_err() in wiz_clock_init() to simplify the code and standardize the error output. Signed-off-by: Thomas Richard --- drivers/phy/ti/phy-j721e-wiz.c | 46 +++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c index 00d7e6a6de03..5fea4df9404e 100644 --- a/drivers/phy/ti/phy-j721e-wiz.c +++ b/drivers/phy/ti/phy-j721e-wiz.c @@ -1088,11 +1088,10 @@ static int wiz_clock_init(struct wiz *wiz, struct device_node *node) int i; clk = devm_clk_get(dev, "core_ref_clk"); - if (IS_ERR(clk)) { - dev_err(dev, "core_ref_clk clock not found\n"); - ret = PTR_ERR(clk); - return ret; - } + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), + "core_ref_clk clock not found\n"); + wiz->input_clks[WIZ_CORE_REFCLK] = clk; rate = clk_get_rate(clk); @@ -1122,11 +1121,10 @@ static int wiz_clock_init(struct wiz *wiz, struct device_node *node) if (wiz->data->pma_cmn_refclk1_int_mode) { clk = devm_clk_get(dev, "core_ref1_clk"); - if (IS_ERR(clk)) { - dev_err(dev, "core_ref1_clk clock not found\n"); - ret = PTR_ERR(clk); - return ret; - } + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), + "core_ref1_clk clock not found\n"); + wiz->input_clks[WIZ_CORE_REFCLK1] = clk; rate = clk_get_rate(clk); @@ -1137,11 +1135,10 @@ static int wiz_clock_init(struct wiz *wiz, struct device_node *node) } clk = devm_clk_get(dev, "ext_ref_clk"); - if (IS_ERR(clk)) { - dev_err(dev, "ext_ref_clk clock not found\n"); - ret = PTR_ERR(clk); - return ret; - } + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), + "ext_ref_clk clock not found\n"); + wiz->input_clks[WIZ_EXT_REFCLK] = clk; rate = clk_get_rate(clk); @@ -1157,8 +1154,9 @@ static int wiz_clock_init(struct wiz *wiz, struct device_node *node) case J721S2_WIZ_10G: ret = wiz_clock_register(wiz); if (ret) - dev_err(dev, "Failed to register wiz clocks\n"); - return ret; + return dev_err_probe(dev, ret, "Failed to register wiz clocks\n"); + + return 0; default: break; } @@ -1167,16 +1165,15 @@ static int wiz_clock_init(struct wiz *wiz, struct device_node *node) node_name = clk_mux_sel[i].node_name; clk_node = of_get_child_by_name(node, node_name); if (!clk_node) { - dev_err(dev, "Unable to get %s node\n", node_name); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, "Unable to get %s node\n", node_name); goto err; } ret = wiz_mux_of_clk_register(wiz, clk_node, wiz->mux_sel_field[i], clk_mux_sel[i].table); if (ret) { - dev_err(dev, "Failed to register %s clock\n", - node_name); + dev_err_probe(dev, ret, "Failed to register %s clock\n", + node_name); of_node_put(clk_node); goto err; } @@ -1188,16 +1185,15 @@ static int wiz_clock_init(struct wiz *wiz, struct device_node *node) node_name = clk_div_sel[i].node_name; clk_node = of_get_child_by_name(node, node_name); if (!clk_node) { - dev_err(dev, "Unable to get %s node\n", node_name); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, "Unable to get %s node\n", node_name); goto err; } ret = wiz_div_clk_register(wiz, clk_node, wiz->div_sel_field[i], clk_div_sel[i].table); if (ret) { - dev_err(dev, "Failed to register %s clock\n", - node_name); + dev_err_probe(dev, ret, "Failed to register %s clock\n", + node_name); of_node_put(clk_node); goto err; } -- 2.39.2