Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp2064783lqp; Tue, 16 Apr 2024 06:33:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU7sdcPMuXjOd0d0uGlsFAxb0NCbUjuHt8p77TwuhTJoMjCycnykw1XY7r9/PaUrc/51p2gc0yy9yRulEh8+c2aOwi95JM6/toLs1PgsA== X-Google-Smtp-Source: AGHT+IGlMZw+tBk2lN4cPZlV9uNSmjh+siOK4I7X7scXl9IFarerCT7jHHFk5iPjWMAYlcZcxFut X-Received: by 2002:a05:6102:26d0:b0:47b:9cb0:9717 with SMTP id m16-20020a05610226d000b0047b9cb09717mr999365vss.5.1713274393494; Tue, 16 Apr 2024 06:33:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713274393; cv=pass; d=google.com; s=arc-20160816; b=LWPqmzBVd5Oq7OYwbZvC9rlvl84CEs3E8Rw0xTj0ZwAn1jT8vVNIEHhK1Y5/tDoJnr c4Z9HVL8cQmwVs6QALjOmkiLoxfJ/CPZH3yEnONMf1K0fG0QdqrOpAJb/HFz13KgB0WH DJyVoot4sgRCq/d6OZM2t2YLz3jN3wist70c7QYIOwAJAbpB4NS5MVIlF75Xx1Yc0zlO dwuAfnMxb+BxyXuT+IF3DVwQYH+q9DVVFwrwU8xOMPAgENAxXrf/12TAS0DloH+RfWGL fJ/wj6aWyQm+n7UOIElR7lYCo0nYqQkTmr1n47TlCHDX3dk7bEHmsSVwPSdb03BSU/7p SMmw== 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=fJFPWxXw72vNyH+gQgC1DthvjYV6wnk21OakN4I7AYs=; fh=5v8VfoUmdAyHJhfbhB8C8hzT4LoOeHBXHUmwWesSrPA=; b=z/XRwLBRnyQ2xZpF9dpKj5NXJCiq02uzwAdSKQjFPI3HvgknZaedDwGzhywJw0po48 q7dUHK9Ueu+Kg4SJSSjHzaAIHW5sD+56T+1rDrfipymjne61cSRk6a095rb1NB7Utq4i gLwnuF3C+SBguUAYtPmcpluiJ9ZO43WFgPKa5owLcxc/6ADoofAO7qEab+Z5CCHV+CZo HFTJS7iFydw0pfqKHTdKIWsaPTKM472YwlSq77c0yVDUK3u100zFovvn1y0SQdr1s2qi WRtQy/PNfr2+/20vrEsC4s3hltmyxjMCZbYrKKe6i9WdCERO7e3NN+60eJudqj0iJYaU d+Qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VyNco7Pc; 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-146887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146887-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x6-20020a0561020c0600b0047b960763c3si222028vss.403.2024.04.16.06.33.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 06:33:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VyNco7Pc; 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-146887-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146887-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 359841C20C04 for ; Tue, 16 Apr 2024 13:33:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48B28130E30; Tue, 16 Apr 2024 13:30:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="VyNco7Pc" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 1985812F589; Tue, 16 Apr 2024 13:30:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713274226; cv=none; b=VkWM5U6skalRcXWe68f74hnxFW98d6KsUPjw4BXo9z+35peZCADw+IyJcUptjZVsQ0+lmKn1mq98aem6/fQifrafABbEStLipAwqcPVRN/oz4wX02e4i3BdECaC/pvzh9qqCsrP9ScodQOrXUm9qJIxPWLzeE+8Ej5S1w5MIT3M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713274226; c=relaxed/simple; bh=Hi7CNJIos7Z9zyfmhn8gv5F7wudXu7ivCs1VjXQ08h0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VZwa2KYSDyAmetjWWo2goXL5HskZ1Uy7lzFL28KeeWHr6mlgmDzbkcrfZhoI9awfCdy5IWnp8NyKR+o8Vmpb3A7fCf6Z7U86MhDWvk9CSU7DdAuxrSgbGEa/ZgsHejqvfoa93ZkI/ettH2ihNxqyIu9ja8hUfEaDFgL9rXyUyvo= 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=VyNco7Pc; arc=none smtp.client-ip=217.70.183.194 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 7D1AC40011; Tue, 16 Apr 2024 13:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713274222; 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=fJFPWxXw72vNyH+gQgC1DthvjYV6wnk21OakN4I7AYs=; b=VyNco7PcCsxO3KWimvVr8QzlealtvOdl0KMlANr9g7PKUiEp6kfotsaXXPWtdohFYY9dLT a3HGChWFLSnbhW3pRSXVJeluXpZ1rs2+Wg5Jv+oSScVb6MKJSFybRgSa2nLcXL1qcoMOv3 eBvRxj4ZDFzLyzdgwj5B24Ugb9AIDwTgzqZbBtThkT4Kl5scQx1nRcfLk/HYibDgZefjUF /zfiRfY7BVTPxYzHftYyyxGnvusSHcujrD3iN5RCB/Uwe//3PgjF7UK8KO2QcB5+P5Clvx 3i9PrLFqQ1515FuiB6bOOK0IDkL2RdKxw8REppZzFr64BQjyyvEvoX7q99FFVw== From: Thomas Richard Date: Tue, 16 Apr 2024 15:29:56 +0200 Subject: [PATCH v5 07/11] PCI: j721e: Use dev_err_probe() in the probe() function 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-v5-7-4b8c46711ded@bootlin.com> References: <20240102-j7200-pcie-s2r-v5-0-4b8c46711ded@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v5-0-4b8c46711ded@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Aaro Koskinen , Janusz Krzysztofik , Vignesh R , Andi Shyti , Peter Rosin , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Siddharth Vadapalli Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com, Thomas Richard , Francesco Dolcini X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com Use dev_err_probe() instead of dev_err() in the probe() function to simplify the code and standardize the error output. Reviewed-by: Francesco Dolcini Signed-off-by: Thomas Richard --- drivers/pci/controller/cadence/pci-j721e.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c index 85718246016b..98484f001562 100644 --- a/drivers/pci/controller/cadence/pci-j721e.c +++ b/drivers/pci/controller/cadence/pci-j721e.c @@ -482,20 +482,20 @@ static int j721e_pcie_probe(struct platform_device *pdev) pm_runtime_enable(dev); ret = pm_runtime_get_sync(dev); if (ret < 0) { - dev_err(dev, "pm_runtime_get_sync failed\n"); + dev_err_probe(dev, ret, "pm_runtime_get_sync failed\n"); goto err_get_sync; } ret = j721e_pcie_ctrl_init(pcie); if (ret < 0) { - dev_err(dev, "pm_runtime_get_sync failed\n"); + dev_err_probe(dev, ret, "pm_runtime_get_sync failed\n"); goto err_get_sync; } ret = devm_request_irq(dev, irq, j721e_pcie_link_irq_handler, 0, "j721e-pcie-link-down-irq", pcie); if (ret < 0) { - dev_err(dev, "failed to request link state IRQ %d\n", irq); + dev_err_probe(dev, ret, "failed to request link state IRQ %d\n", irq); goto err_get_sync; } @@ -505,28 +505,25 @@ static int j721e_pcie_probe(struct platform_device *pdev) case PCI_MODE_RC: gpiod = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(gpiod)) { - ret = PTR_ERR(gpiod); - if (ret != -EPROBE_DEFER) - dev_err(dev, "Failed to get reset GPIO\n"); + ret = dev_err_probe(dev, PTR_ERR(gpiod), "Failed to get reset GPIO\n"); goto err_get_sync; } ret = cdns_pcie_init_phy(dev, cdns_pcie); if (ret) { - dev_err(dev, "Failed to init phy\n"); + dev_err_probe(dev, ret, "Failed to init phy\n"); goto err_get_sync; } clk = devm_clk_get_optional(dev, "pcie_refclk"); if (IS_ERR(clk)) { - ret = PTR_ERR(clk); - dev_err(dev, "failed to get pcie_refclk\n"); + ret = dev_err_probe(dev, PTR_ERR(clk), "failed to get pcie_refclk\n"); goto err_pcie_setup; } ret = clk_prepare_enable(clk); if (ret) { - dev_err(dev, "failed to enable pcie_refclk\n"); + dev_err_probe(dev, ret, "failed to enable pcie_refclk\n"); goto err_pcie_setup; } pcie->refclk = clk; @@ -554,7 +551,7 @@ static int j721e_pcie_probe(struct platform_device *pdev) case PCI_MODE_EP: ret = cdns_pcie_init_phy(dev, cdns_pcie); if (ret) { - dev_err(dev, "Failed to init phy\n"); + dev_err_probe(dev, ret, "Failed to init phy\n"); goto err_get_sync; } -- 2.39.2