From patchwork Wed Apr 2 12:31:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Yan X-Patchwork-Id: 14035963 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 86593C36017 for ; Wed, 2 Apr 2025 12:48: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=4DKvdKcHiK2hUoeQYaEP0h16/mFtikB1/gSqnonh+Ew=; b=fwGqmVig0cexLl dyI92VK/KGcNtIg6N82ZyKv/z+BH49+hWubGxHuWNGVdthSe/UoAg3+0zUxCDRak//cZgtK6VNqWX 42iH+zNNlRuO58YmaYURUYS3C00F/hL0DpLJCnnBlni7ZWasIwdmLhRJiY9520SwY3yAAREk2tY5R qJXdWCLrgTVfD7g75ci7gl2cUTEZn6+lOSEZ2t30FVlkGG1Jvz4YC0gqJm+IJKKpqxBf8WQjLnF/e 0dJV8LypdxzxXF6tAy6h28/SKfT5TVkROx9zSQdkZ9vMGkW/bmqiAu81dB4o7xnf8BPP1Oo00qrSn GvRadorhM1p12zZyd3Sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzxVk-000000068DQ-3vrC; Wed, 02 Apr 2025 12:48:04 +0000 Received: from m16.mail.163.com ([220.197.31.5]) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzxGe-000000065NU-3xeY; Wed, 02 Apr 2025 12:32:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=SAmBQ fQ4gtVQYYiOf9e8DZppYPFI9MirWXA6gFfsoeE=; b=MGTwIXCl6X63pnKuYAA0r pXDerXH7TBHXky8AaQZOE3YVkWYj7hrNbRQl9F7ffYA9A2/7BYHcTXEJO5429OB0 Qh4s+pyuAJfJwbsjBzFf3HG8m3GbJnnTghIrD6UkgaYt4MMUppHNtk5lmuoWmCc8 PBzyuDtQF8fIlHIv6oVfgM= Received: from ProDesk.. (unknown []) by gzsmtp4 (Coremail) with SMTP id PygvCgDnd405Lu1nJwOJBA--.36321S5; Wed, 02 Apr 2025 20:32:00 +0800 (CST) From: Andy Yan To: heiko@sntech.de Cc: conor+dt@kernel.org, krzk+dt@kernel.org, robh@kernel.org, hjc@rock-chips.com, mripard@kernel.org, neil.armstrong@linaro.org, dmitry.baryshkov@oss.qualcomm.com, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Andy Yan Subject: [PATCH v3 3/7] drm/rockchip: inno-hdmi: Simplify error handler with dev_err_probe Date: Wed, 2 Apr 2025 20:31:37 +0800 Message-ID: <20250402123150.238234-4-andyshrk@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250402123150.238234-1-andyshrk@163.com> References: <20250402123150.238234-1-andyshrk@163.com> MIME-Version: 1.0 X-CM-TRANSID: PygvCgDnd405Lu1nJwOJBA--.36321S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7uryfXr4fuF1fJr4Utr1xuFg_yoW8Aw1Dpr ZxJFyjvFy8JF18W347ua15Ar1Sya1Uta18CrZrGwn5Zw17Zrs8try3ZFWFqrWFyF95Zw4a y393Xa4UZ3W7WaUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jJkuxUUUUU= X-Originating-IP: [58.22.7.114] X-CM-SenderInfo: 5dqg52xkunqiywtou0bp/xtbB0gMjXmftK+o5ZwAAs5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250402_053229_362074_51A8B0C3 X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Andy Yan Use dev_err_probe simplify the error handle. Signed-off-by: Andy Yan --- (no changes since v2) Changes in v2: - First included in this series drivers/gpu/drm/rockchip/inno_hdmi.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 483ecfeaebb08..e891d42dd08a4 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -885,29 +885,22 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, return PTR_ERR(hdmi->regs); hdmi->pclk = devm_clk_get(hdmi->dev, "pclk"); - if (IS_ERR(hdmi->pclk)) { - DRM_DEV_ERROR(hdmi->dev, "Unable to get HDMI pclk clk\n"); - return PTR_ERR(hdmi->pclk); - } + if (IS_ERR(hdmi->pclk)) + return dev_err_probe(dev, PTR_ERR(hdmi->pclk), "Unable to get HDMI pclk\n"); ret = clk_prepare_enable(hdmi->pclk); - if (ret) { - DRM_DEV_ERROR(hdmi->dev, - "Cannot enable HDMI pclk clock: %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Cannot enable HDMI pclk: %d\n", ret); hdmi->refclk = devm_clk_get_optional(hdmi->dev, "ref"); if (IS_ERR(hdmi->refclk)) { - DRM_DEV_ERROR(hdmi->dev, "Unable to get HDMI reference clock\n"); - ret = PTR_ERR(hdmi->refclk); + ret = dev_err_probe(dev, PTR_ERR(hdmi->refclk), "Unable to get HDMI refclk\n"); goto err_disable_pclk; } ret = clk_prepare_enable(hdmi->refclk); if (ret) { - DRM_DEV_ERROR(hdmi->dev, - "Cannot enable HDMI reference clock: %d\n", ret); + ret = dev_err_probe(dev, ret, "Cannot enable HDMI refclk: %d\n", ret); goto err_disable_pclk; }