From patchwork Tue Dec 17 15:43:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 13912118 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 A82CAE77184 for ; Tue, 17 Dec 2024 16:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ytKdrhAW4uPHSAeyjhF4je2DzZn5a+lOVTRXR49eeWU=; b=LS5X3CfHogAo8g1GykBwjGH5CG XZUDgjgd5fYZrCgBi9IDk5jdehqfEwQiNYcpSLfzsata5RSqxXBwk68+CUQjrzkUlXHgBSWH19YkN VJqQacs6hZWVeL8A+qmqIRxLENGgOpIyNtfOrzkRwbQfsZRAj76Cv4vaPFSIRM7t2P1w42Tx6vb5w UnmM4y8JHmnZ3cToW2aHxAHe8cRJx1i7ALoTCjrNlP9N4HROD/DKl3dlizyRsEPbFzGSuKWdwtTEY 5ysSEp56h5HAR8sbNLqUwE03M5FLrQRapyiqLeWxqSamp0eVPNBrYs0iuTg0OazTawt6CiKEo6q3D 1VzlGInw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNa5J-0000000E5MU-1khi; Tue, 17 Dec 2024 16:06:09 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNZkB-0000000E05D-22qj; Tue, 17 Dec 2024 15:44:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1734450258; bh=eS/Fbh3gYUfMYZO7irNmf6AE0VLkc+opJ68mgu+vaws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GattxcTMSR+xRDKcGZiCOKb8DDZh14IE8sMnCJdSxlfprwaZ5nTAPShayail1DGmr AokCvNOObrq6LbAhC8YZ5zUZP4g1LY9fR/UkNuOX5x544nkc1+mXnR7q79vqIIrNTl fx9aZHBw9JPBVrnQ+kCw6ls+v6yu0SguAppUS/u90WSb9LTy69Es3bGEXD4ceZt86v stYmeXWsu1bmNUwAGPJ17m4kYcoQDibCM3tBNmzU7YFSOb9lqwQfct/YJXzvfbC11w /63ek+E5SFLujRHH7N2WCbE1Ah0OD3epHbLqzsf2Ise6WvzOFhXFx3VUH/tPmA+vR4 P9o3WhBjLEicw== Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by bali.collaboradmins.com (Postfix) with ESMTPSA id C0CDD17E37C5; Tue, 17 Dec 2024 16:44:16 +0100 (CET) From: AngeloGioacchino Del Regno To: chunkuang.hu@kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, simona@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, ck.hu@mediatek.com, jitao.shi@mediatek.com, jie.qiu@mediatek.com, junzhi.zhao@mediatek.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, dmitry.baryshkov@linaro.org Subject: [PATCH v3 19/33] drm/mediatek: mtk_hdmi: Use dev_err_probe() in mtk_hdmi_dt_parse_pdata() Date: Tue, 17 Dec 2024 16:43:31 +0100 Message-ID: <20241217154345.276919-20-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241217154345.276919-1-angelogioacchino.delregno@collabora.com> References: <20241217154345.276919-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241217_074419_700564_831A7B16 X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Change error prints to use dev_err_probe() instead of dev_err() where possible in function mtk_hdmi_dt_parse_pdata(), used only during device probe. While at it, also beautify some prints. Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_hdmi.c | 34 ++++++++++------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index eb38f4b7674e..c20d42ec387a 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -1372,30 +1372,23 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; - struct device_node *cec_np, *remote, *i2c_np; + struct device_node *remote, *i2c_np; struct platform_device *cec_pdev; struct regmap *regmap; int ret; ret = mtk_hdmi_get_all_clk(hdmi, np); - if (ret) { - if (ret != -EPROBE_DEFER) - dev_err(dev, "Failed to get clocks: %d\n", ret); - - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to get clocks\n"); /* The CEC module handles HDMI hotplug detection */ cec_np = of_get_compatible_child(np->parent, "mediatek,mt8173-cec"); - if (!cec_np) { - dev_err(dev, "Failed to find CEC node\n"); - return -EINVAL; - } + if (!cec_np) + return dev_err_probe(dev, -EINVAL, "Failed to find CEC node\n"); cec_pdev = of_find_device_by_node(cec_np); if (!cec_pdev) { - dev_err(hdmi->dev, "Waiting for CEC device %pOF\n", - cec_np); + dev_err(hdmi->dev, "Waiting for CEC device %pOF\n", cec_np); of_node_put(cec_np); return -EPROBE_DEFER; } @@ -1413,9 +1406,8 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, if (IS_ERR(regmap)) ret = PTR_ERR(regmap); if (ret) { - dev_err(dev, - "Failed to get system configuration registers: %d\n", - ret); + dev_err_probe(dev, ret, + "Failed to get system configuration registers\n"); goto put_device; } hdmi->sys_regmap = regmap; @@ -1443,20 +1435,16 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, } i2c_np = of_parse_phandle(remote, "ddc-i2c-bus", 0); + of_node_put(remote); if (!i2c_np) { - dev_err(dev, "Failed to find ddc-i2c-bus node in %pOF\n", - remote); - of_node_put(remote); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, "No ddc-i2c-bus in connector\n"); goto put_device; } - of_node_put(remote); hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np); of_node_put(i2c_np); if (!hdmi->ddc_adpt) { - dev_err(dev, "Failed to get ddc i2c adapter by node\n"); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, "Failed to get ddc i2c adapter by node\n"); goto put_device; }