From patchwork Mon Sep 24 16:22:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10612671 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABC4713A4 for ; Mon, 24 Sep 2018 16:22:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97A2429C92 for ; Mon, 24 Sep 2018 16:22:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C2C229CA7; Mon, 24 Sep 2018 16:22:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3177429C92 for ; Mon, 24 Sep 2018 16:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731445AbeIXWZf (ORCPT ); Mon, 24 Sep 2018 18:25:35 -0400 Received: from mail-yw1-f67.google.com ([209.85.161.67]:33744 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbeIXWZf (ORCPT ); Mon, 24 Sep 2018 18:25:35 -0400 Received: by mail-yw1-f67.google.com with SMTP id x67-v6so8113610ywg.0 for ; Mon, 24 Sep 2018 09:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Mz6ky8FkeL7/vUg2/xiKlIKHogah2/rLOMaIK8Uofmk=; b=MeSbc3JoHn7wr3tLgDiqqZO8+N94IBlGhRKt6Cs7lfGrHlUfBdRmSHLyy/K+w+tIgo RHfx7MuHEhW/BUjhpqMl6q0JWm5wo8GsExbVfR2ozkQrsmjzjagu9TW+Krs6MMnGkpqz GswmmFKbgWkQON7Tz/V/KQEIhxyyuSNnKX6Og= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Mz6ky8FkeL7/vUg2/xiKlIKHogah2/rLOMaIK8Uofmk=; b=TcS534TCEpUMWiLqGlkGHzfGvQo7ZAPJlyL0Qdbi9bvaRQX8QtWr74KkXEtsCCjP5I /NNZa/dzCTBLPk/CuA5Act7FXBdNvJBD22PJjduH38Ct2CZdV7rT2hIEyRPQZxdhs9Ga pdEcmvmC+pxjthCMbLmB279aq+dioLnr3BSL+pVZrm1MdoreSiTDSYA7MIZCnOTdzO0H L41fjiDDOm/7mA9yZYu3F99ie+MIme5s9Pa+GEmKBeyLxsT+HElMEJe3e/e8P22W/XBo 6uVNQsvmC/g0WQtx4QCuY8r7BpZHRPHzIC1/qinzvYldicaPPS4TuV9Qma8yrKjRGy2e bxjQ== X-Gm-Message-State: APzg51BUMgsUsfzDBHU9XCcJdnvudJI+k/RwYy7HJGezg6BbxI05UNUV ee4SLU+bk1CgxcZpDeAN1ds1Kw== X-Google-Smtp-Source: ANB0VdaY8zGgVrE3qrjukSwR8yHytHTJFuVdiopuF+T9uWDliyF1z7fLP261Qk7SartYCPvptczpJQ== X-Received: by 2002:a81:b643:: with SMTP id h3-v6mr4854105ywk.429.1537806158187; Mon, 24 Sep 2018 09:22:38 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id v34-v6sm9791001ywh.45.2018.09.24.09.22.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 09:22:36 -0700 (PDT) From: Bruce Wang To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: seanpaul@chromium.org, jsanka@codeaurora.org, robdclark@gmail.com, abhinavk@codeaurora.org, jcrouse@codeaurora.org Subject: [PATCH v3 4/7] drm/msm/dpu: Change _dpu_crtc_power_enable to void Date: Mon, 24 Sep 2018 12:22:25 -0400 Message-Id: <20180924162228.180689-5-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.444.g18242da7ef-goog In-Reply-To: <20180924162228.180689-1-bzwang@chromium.org> References: <20180924162228.180689-1-bzwang@chromium.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All checks for _dpu_crtc_power_enable are not true, so the function can never return an error code. All calls of the function have also been changed so that they don't expect a return value. v3: Separated _dpu_crtc_power_enable into _dpu_crtc_power_enable and _dpu_crtc_power_disable for clarity. Signed-off-by: Bruce Wang Reviewed-by: Jordan Crouse --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 44 ++++++------------------ 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index e31e70f5dbac..cb71e2a2e02e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -60,37 +60,19 @@ static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) return to_dpu_kms(priv->kms); } -static inline int _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc, bool enable) -{ - struct drm_crtc *crtc; - struct msm_drm_private *priv; - struct dpu_kms *dpu_kms; - - if (!dpu_crtc) { - DPU_ERROR("invalid dpu crtc\n"); - return -EINVAL; - } - - crtc = &dpu_crtc->base; - if (!crtc->dev || !crtc->dev->dev_private) { - DPU_ERROR("invalid drm device\n"); - return -EINVAL; - } - priv = crtc->dev->dev_private; - if (!priv->kms) { - DPU_ERROR("invalid kms\n"); - return -EINVAL; - } +static inline void _dpu_crtc_power_enable(struct dpu_crtc *dpu_crtc) +{ + struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(&dpu_crtc->base); - dpu_kms = to_dpu_kms(priv->kms); + pm_runtime_get_sync(&dpu_kms->pdev->dev); +} - if (enable) - pm_runtime_get_sync(&dpu_kms->pdev->dev); - else - pm_runtime_put_sync(&dpu_kms->pdev->dev); +static inline void _dpu_crtc_power_disable(struct dpu_crtc *dpu_crtc) +{ + struct dpu_kms *dpu_kms = _dpu_crtc_get_kms(&dpu_crtc->base); - return 0; + pm_runtime_put_sync(&dpu_kms->pdev->dev); } static void dpu_crtc_destroy(struct drm_crtc *crtc) @@ -823,14 +805,10 @@ static int _dpu_crtc_vblank_enable_no_lock( dev = crtc->dev; if (enable) { - int ret; - /* drop lock since power crtc cb may try to re-acquire lock */ mutex_unlock(&dpu_crtc->crtc_lock); - ret = _dpu_crtc_power_enable(dpu_crtc, true); + _dpu_crtc_power_enable(dpu_crtc); mutex_lock(&dpu_crtc->crtc_lock); - if (ret) - return ret; list_for_each_entry(enc, &dev->mode_config.encoder_list, head) { if (enc->crtc != crtc) @@ -857,7 +835,7 @@ static int _dpu_crtc_vblank_enable_no_lock( /* drop lock since power crtc cb may try to re-acquire lock */ mutex_unlock(&dpu_crtc->crtc_lock); - _dpu_crtc_power_enable(dpu_crtc, false); + _dpu_crtc_power_disable(dpu_crtc); mutex_lock(&dpu_crtc->crtc_lock); }