From patchwork Tue Sep 12 16:55:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13381964 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4FC67CA0EF1 for ; Tue, 12 Sep 2023 16:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=FFwbjif1NAiYKOI39X8sfj/sPIt8HOMijAM5R9Ns/Ts=; b=gL9lwQQq1RKgvY gky5xqFnssdgs9lKC35zOL8ntxmYPtD9pyUCpXTwMK8/USzjlxbjNYeXZQLQr6fi4L9Wm83g3unat 0BujvfZQQtwpkPqS1y1p3kHQsbSviKTmX1Uov9YrUelIxhcjBOavmOy1Q0GM4Dli0dxGQ3jbTtiyC sfJPp2YRqQMV5kvlTw2Ewz3uaXaetk397HwqSS17yLE0V+x9cFiaC7k0L4e+rdPGaPFloH791QOcI LEveTdLDS4NP4WvPlaI0EibTE4omBWPU2j0Ltxp4MAGjKyqoCX25SWfTKhWGdXfdgk15w93oZIRrC 91DLxGyR1CTvQRTMuqzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qg6gQ-003sKs-1I; Tue, 12 Sep 2023 16:56:14 +0000 Received: from mgamail.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qg6gN-003sKV-19 for linux-arm-kernel@lists.infradead.org; Tue, 12 Sep 2023 16:56:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694537771; x=1726073771; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6oK3QKUyE2J6G3j5C3mGEJEaadkE/lTt0pjP5XqCoTA=; b=LctirEQMcvjYQ0xQbHDKALQzAkrCKuuGMVXVec1PNNxfPZabnlTdYdP3 ZbJ+aFCuakOjUhsMudRFmSWFNpkUpQ6L4piIjDOQlzBjLd81XB8Cqu9ky SMSrddyqaqtvr6YGZEpbCrp7kDw7kgSCao+8NmQXVvv5HGD1GM44T7g7p g+bnOQyyXzRVWtSJSKuIIoM1+Qk7gjy1v9jMj6SJvhFc5Q9QN9hs1oMht HJXNqsd4duCvdpnssCUMaNo7EreudjW43D2X234gAqzN+PD4IQdK+SaVa +Rtv5oRsSPmROTgHLWpH8cEtttXSYV/prh1slmGBRRM4n6jqsoWkvBq+R w==; X-IronPort-AV: E=McAfee;i="6600,9927,10831"; a="381135987" X-IronPort-AV: E=Sophos;i="6.02,139,1688454000"; d="scan'208";a="381135987" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2023 09:55:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10831"; a="746968566" X-IronPort-AV: E=Sophos;i="6.02,139,1688454000"; d="scan'208";a="746968566" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 12 Sep 2023 09:55:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 76B6C248; Tue, 12 Sep 2023 19:55:45 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org Cc: Greg Kroah-Hartman , Jiri Slaby , Joel Stanley , Andrew Jeffery Subject: [PATCH v1 1/1] serial: 8250_aspeed_vuart: Use dev_err_probe() instead of dev_err() Date: Tue, 12 Sep 2023 19:55:40 +0300 Message-Id: <20230912165540.402504-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230912_095611_456216_8B7AE852 X-CRM114-Status: GOOD ( 13.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The probe process may generate EPROBE_DEFER. In this case dev_err_probe() can still record err information. Otherwise it may pollute logs on that occasion. This also helps simplifing code and standardizing the error output. Signed-off-by: Andy Shevchenko --- drivers/tty/serial/8250/8250_aspeed_vuart.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c index 4a9e71b2dbbc..7a4537a1d66c 100644 --- a/drivers/tty/serial/8250/8250_aspeed_vuart.c +++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c @@ -415,6 +415,7 @@ static int aspeed_vuart_map_irq_polarity(u32 dt) static int aspeed_vuart_probe(struct platform_device *pdev) { struct of_phandle_args sirq_polarity_sense_args; + struct device *dev = &pdev->dev; struct uart_8250_port port; struct aspeed_vuart *vuart; struct device_node *np; @@ -455,9 +456,8 @@ static int aspeed_vuart_probe(struct platform_device *pdev) if (of_property_read_u32(np, "clock-frequency", &clk)) { vuart->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(vuart->clk)) { - dev_warn(&pdev->dev, - "clk or clock-frequency not defined\n"); - rc = PTR_ERR(vuart->clk); + rc = dev_err_probe(dev, PTR_ERR(vuart->clk), + "clk or clock-frequency not defined\n"); goto err_sysfs_remove; } @@ -533,7 +533,7 @@ static int aspeed_vuart_probe(struct platform_device *pdev) rc = aspeed_vuart_set_lpc_address(vuart, prop); if (rc < 0) { - dev_err(&pdev->dev, "invalid value in aspeed,lpc-io-reg property\n"); + dev_err_probe(dev, rc, "invalid value in aspeed,lpc-io-reg property\n"); goto err_clk_disable; } @@ -545,14 +545,14 @@ static int aspeed_vuart_probe(struct platform_device *pdev) rc = aspeed_vuart_set_sirq(vuart, sirq[0]); if (rc < 0) { - dev_err(&pdev->dev, "invalid sirq number in aspeed,lpc-interrupts property\n"); + dev_err_probe(dev, rc, "invalid sirq number in aspeed,lpc-interrupts property\n"); goto err_clk_disable; } sirq_polarity = aspeed_vuart_map_irq_polarity(sirq[1]); if (sirq_polarity < 0) { - dev_err(&pdev->dev, "invalid sirq polarity in aspeed,lpc-interrupts property\n"); - rc = sirq_polarity; + rc = dev_err_probe(dev, sirq_polarity, + "invalid sirq polarity in aspeed,lpc-interrupts property\n"); goto err_clk_disable; }