From patchwork Wed Sep 19 15:44:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10606045 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 63FED1390 for ; Wed, 19 Sep 2018 15:44:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 547B528714 for ; Wed, 19 Sep 2018 15:44:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48A18286DC; Wed, 19 Sep 2018 15:44:33 +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 DDE8E286DC for ; Wed, 19 Sep 2018 15:44:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732527AbeISVXC (ORCPT ); Wed, 19 Sep 2018 17:23:02 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:35464 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732294AbeISVXC (ORCPT ); Wed, 19 Sep 2018 17:23:02 -0400 Received: by mail-yw1-f66.google.com with SMTP id 14-v6so2456602ywe.2 for ; Wed, 19 Sep 2018 08:44:31 -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=ah6vEE8a0Oo8APzDXS7KTOfBCzYSCNJjfPi8NKZ5qsw=; b=fgTtus+rUa2YevHC1AfliG74TRLa0rmkMYQyWYZL3RNeY0LYC4TpiFP5n8219OvmwZ F7Q8+Ko/RNab93Dz89rExDZ7p8ZAzjnQWHhuFwiAEph0qp4fbvAHG6sfbVlsr1SV+fhy FV/Um1dJXl+sDrfSMI4XU6GmOHEUBl9u9gXVY= 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=ah6vEE8a0Oo8APzDXS7KTOfBCzYSCNJjfPi8NKZ5qsw=; b=BppqgY8jHybGD5KxqOV10KaPKFxx0RefG7qZRdtvw3MPnE+HB3I0YwFmJgoTJgN4Ex Ie46zp9czD6nHBiz0GQ8bcUwL6/tBPSlHSUOCNGt66VD3kLrlRbjXMfk1q8ozxLxKI8s imyPxY8JoN8A+1/lFKFLd06DgGPAlr/Z16rsrSOuXvARtD3/Y5Gf8suSWjM9GV9zJ+Pb 7/80rvc6CPs//F+yOFQWkph47FnTAa/oCgQHjSCxZfQYRd275ap7OcmXj88iwOxGaQdZ T9RvtoUtxYTtsaOlaLQkn7yDuo886jczSpVxx2wyJ/ZKz7TOaxRbBV5mVFoZYNoE+hwk fFSA== X-Gm-Message-State: APzg51B6bLLINEnDaO8zReHhQZaJk9mxWm2NeySY3CV9S21UtVwNakr+ aTvSOzyJDbbJXWNlxg7Y+zFGig== X-Google-Smtp-Source: ANB0VdZTTt9nVs+LBj+z0BvZjV5eXcCnaC2jfx66w9BZe+qKJKVPg3ZURPy88g9ZpVPBseI24gXP6g== X-Received: by 2002:a81:ac44:: with SMTP id z4-v6mr14689429ywj.31.1537371870894; Wed, 19 Sep 2018 08:44:30 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id h10-v6sm4425921ywa.35.2018.09.19.08.44.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 08:44:29 -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, Bruce Wang Subject: [PATCH 4/5] drm/msm/dpu: Change _dpu_crtc_power_enable to void Date: Wed, 19 Sep 2018 11:44:14 -0400 Message-Id: <20180919154415.131292-5-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.397.gdd90340f6a-goog In-Reply-To: <20180919154415.131292-1-bzwang@chromium.org> References: <20180919154415.131292-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. Signed-off-by: Bruce Wang Reviewed-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 35 ++++-------------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 017d16131dac..f0b52281c46f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -60,37 +60,16 @@ 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) +static inline void _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; - } - - dpu_kms = to_dpu_kms(priv->kms); + struct drm_crtc *crtc = &dpu_crtc->base; + struct msm_drm_private *priv = crtc->dev->dev_private; + struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms); if (enable) pm_runtime_get_sync(&dpu_kms->pdev->dev); else pm_runtime_put_sync(&dpu_kms->pdev->dev); - - return 0; } static void dpu_crtc_destroy(struct drm_crtc *crtc) @@ -849,14 +828,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, true); 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)