From patchwork Thu Nov 23 17:54:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13466518 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 F41AAC61D97 for ; Thu, 23 Nov 2023 17:55:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 24AB510E002; Thu, 23 Nov 2023 17:55:22 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC79910E002 for ; Thu, 23 Nov 2023 17:55:20 +0000 (UTC) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r6Duf-0004l5-I1; Thu, 23 Nov 2023 18:54:53 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r6Dud-00B5eK-6t; Thu, 23 Nov 2023 18:54:51 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r6Duc-006rAy-TY; Thu, 23 Nov 2023 18:54:50 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Bjorn Andersson , Douglas Anderson Subject: [PATCH 1/3] drm/bridge: ti-sn65dsi86: Simplify using pm_runtime_resume_and_get() Date: Thu, 23 Nov 2023 18:54:27 +0100 Message-ID: <20231123175425.496956-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231123175425.496956-1-u.kleine-koenig@pengutronix.de> References: <20231123175425.496956-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=921; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=M2F3whZ53fZeV1tkPUxtfCf5sLaynpDgHuGMcwfXfV8=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtT4iZfS5jWmKrBqzhDl36/yRyfs83sjcff3PvNezlt/f 2Nj0RPBTkZjFgZGLgZZMUUW+8Y1mVZVcpGda/9dhhnEygQyhYGLUwAm8jKQ/Z9hkIYtR8xy29j9 B5k/M+eJMk2tPb/E0y1k8lLGF1JNmrOa6/YmX93gP23+Pdd+M6Xu7KeJkvJM2ba60VurDOzU21v yZJQTla8azi6xvMLHY+nJLV/Csb1zRph+f+0jodmnlW4FP+WoTKqfqFgyU7pfTea2+a0y202d9z bUSN+/2rzx21I71ZWxKnFqYgJ2AQ5lKftjfJTiT3BuK6rl75GMMZj+Mq7tblK+deHCh/fU/m3Nb yg+N9G1JJTt9NGc5V+W1Zvv0hCNZ5TbW2LSWbCi/t9kJdd8f6ECiZNp1rmf1lcsnvjrS374gp+3 sj+yWZ4vymSXT35Tf0FP8cG7jPdi194xb2V64WvvYAMA X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Ripard , Neil Armstrong , Robert Foss , Thomas Zimmermann , Jonas Karlman , dri-devel@lists.freedesktop.org, Jernej Skrabec , Thierry Reding , Laurent Pinchart , Andrzej Hajda , kernel@pengutronix.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" pm_runtime_resume_and_get() already drops the runtime PM usage counter in the error case. So a call to pm_runtime_put_sync() can be dropped. Signed-off-by: Uwe Kleine-König Reviewed-by: Neil Armstrong Reviewed-by: Douglas Anderson Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index c45c07840f64..5b8e1dfc458d 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -1413,11 +1413,9 @@ static int ti_sn_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, int ret; if (!pdata->pwm_enabled) { - ret = pm_runtime_get_sync(pdata->dev); - if (ret < 0) { - pm_runtime_put_sync(pdata->dev); + ret = pm_runtime_resume_and_get(pdata->dev); + if (ret < 0) return ret; - } } if (state->enabled) {