Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp523687rdb; Thu, 15 Feb 2024 07:20:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVUZ8oFDnPRZXfTWKarki5t3eJwNEf9vRZg8NYPyIs7zU1pmEV0xp9b+BQnHikYto8/y8IW1qZ6JGmh81ru00CRXj2wdlL+ZAhn4tR/2Q== X-Google-Smtp-Source: AGHT+IGOkAid9k2+OxR9KenixO19I/Q24Fww1W6T4+kvt1OEZeKKtPJEAt/g3axWCbrP5AsQyeJq X-Received: by 2002:a17:906:711b:b0:a3d:1bc2:e0df with SMTP id x27-20020a170906711b00b00a3d1bc2e0dfmr1329724ejj.32.1708010410530; Thu, 15 Feb 2024 07:20:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708010410; cv=pass; d=google.com; s=arc-20160816; b=l77PRdqajCc26XWdm93qO2qZ4vNu5SQBRaM3+l7HZjg86U7jT+Dt5qR4/zvbD2T46N 2Fd8U/XFpnVazB7NgHTo+et/toIrJYm0Dsiz1c9kUJj4/B6HDvqNe6DvmzIBxyVnNk2N kjcjgB3HkDwVHcOYHw6DBFOkUp2xpI2OlrSzKFZyQDggFuLFUYdWmR13Ybiw8b1XDJgg QbFydUPCnPG5MwM2inC7ata+o8iLYRBKvDpwUJJeJXl6WIFoyH9Wla0qUMh4qYHxtUdK JpCC3IEKz/dWVFTwUmDKnKV/l1yYsF2KfriGFpPakr/n5+1jeDlwOPxTbiyEiGnz9QM2 a+Jg== 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=FJYNJtMOR5pLpoIfNaokG07UEIar6ENzddhLhwstigw=; fh=wHZQkXie84v2FP+2z7dUEuyvptHwnAyqgx34WxJkhrY=; b=iJQbUxFqQ3Bd9ilQhZRZhCbKexvwfnjNMN7CEiDkosJA5BziANp4Nd2/JAemshjOBe NWjSAsSWab2UxHfF/QgnMF9ZJJWGTZiMp1HkEmtEqxycQWBswcEugfu8JMQN7niNTvrP +qsRcT+ZEX0RrOasAEwNMT9WBv56LjarHqOliVSHL5Am04v6FCL1fSBkYdHTk8E2qaA2 5mI/BJ2BufDVR8J06yz6fLQOwy+zCbqP7w1+OtU3LzsaNilIpksmMjv65K90NlkBGHqX /9hpLAywciuEjQOTqu6onsNBUuhqFa4CoW4aNAwSsLiOmBKZbjfo+k0F0LYq6GM3NpiD 0i+w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="QzmTPi/x"; 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-67154-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67154-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 lc8-20020a170906f90800b00a3ced40a25bsi715268ejb.712.2024.02.15.07.20.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:20:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67154-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=@bootlin.com header.s=gm1 header.b="QzmTPi/x"; 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-67154-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67154-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4AC7A1F228C5 for ; Thu, 15 Feb 2024 15:20:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 063C9134CE4; Thu, 15 Feb 2024 15:18:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QzmTPi/x" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 4C656133414; Thu, 15 Feb 2024 15:18:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010292; cv=none; b=Ofi7o1cDvO54EZXBgT4TlM00I7JAypGcrXTGvJv/IIws/1O14QppY9yZqJNCWB7tmhMGtPkZoTqDIEA809uutvwYR3apNnevlo27njUrAuiKQQ4r4PUkQp3m2/pXqCaQdbiMDRCYonc9ZkcEDJACsKB/ZwSxQcfm3s0mrxUM7Co= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010292; c=relaxed/simple; bh=YGEmOsFMNcXlDNc56Lgxm1tdg2BtX/PFl7Zx00rRIxE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rhZb6qIehZYHq4V8dHV1ZM3j3n9jxwNt1mr87mWGuJv/AIOn+Jk/weJjkYXCCoDQJnCGBm0vcOtQiHHinrgQvX6wZHLKVMOyWW7Q2rH2yiFlbDsjCe+28UQOEDxMgTDQMnNBLrV436jZKrcnlkn8Ri+UxPDI1BDep5LgTHiaVKo= 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=QzmTPi/x; arc=none smtp.client-ip=217.70.183.193 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 5238224000B; Thu, 15 Feb 2024 15:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708010287; 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=FJYNJtMOR5pLpoIfNaokG07UEIar6ENzddhLhwstigw=; b=QzmTPi/xi1lzPXKjWZi8IsqH1gG0tk+au3AIC9A497Ujqo734s0p+l9w3RzzdvZX8NmL6R KVOQQu0vqfCOEQzkFk+OjGmLNvLvk0exFB+KIsJt0/kDtOVrJwndybcZmomS7rjZWcQl2/ 7iCECEmbkIRrfQbxHfRWi0ftRWGLwxTQaPJ6hDg4JA8pyH/7z77HDB6/8OoUnlvL5npcp6 rvCQ8tVY6gubbBNLh6Z6Aw0KJ2TL4kv12ZaF35aj7CEqtbyzPrUlXqWs6EfAux0aTmewYL E1DyrfghHx5R+xCqxzGMZi/+oQf0KtyQ+jyrU9ZOHD5fuKJjLvwSMDRme3PJwg== From: Thomas Richard Date: Thu, 15 Feb 2024 16:17:52 +0100 Subject: [PATCH v3 07/18] 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: <20240102-j7200-pcie-s2r-v3-7-5c2e4a3fac1f@bootlin.com> References: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@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 | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c index fc3cd98c60ff..ce8a99801a4c 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,7 +1154,7 @@ 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"); + dev_err_probe(dev, ret, "Failed to register wiz clocks\n"); return ret; default: break; @@ -1175,8 +1172,8 @@ static int wiz_clock_init(struct wiz *wiz, struct device_node *node) 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,16 @@ 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; + dev_err_probe(dev, ret, "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