From patchwork Thu Sep 20 16:49:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Wang X-Patchwork-Id: 10608213 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 CA93615E8 for ; Thu, 20 Sep 2018 16:49:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBC012E179 for ; Thu, 20 Sep 2018 16:49:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B051D2E1A7; Thu, 20 Sep 2018 16:49:35 +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 5BC5A2E179 for ; Thu, 20 Sep 2018 16:49:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731091AbeITWd4 (ORCPT ); Thu, 20 Sep 2018 18:33:56 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:33205 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730936AbeITWd4 (ORCPT ); Thu, 20 Sep 2018 18:33:56 -0400 Received: by mail-yb1-f196.google.com with SMTP id y9-v6so4212870ybh.0 for ; Thu, 20 Sep 2018 09:49:34 -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=8xtOyTruxFBprnUDZUAbb2q7kL56QEAmTr9EdY+5UH0=; b=IlHn2+kmbGy+Z2Wsd2i7gvfzUKNqIHo0WisfQg2tWrXFzxbep3vEWB9rbN51se0JJV L6i5F4VwBIJSzt8RLRznExkebFJSzy7XgIu+BDozDls/o54zXYIK8BbJfI26fg66lXUW YKh46aFkIlzeU2pckOzeDQhc7VN4srTqjMwiI= 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=8xtOyTruxFBprnUDZUAbb2q7kL56QEAmTr9EdY+5UH0=; b=TpwvssBfF05tBUCNJ5SnZvhMIKPz6MM7p7L/bCd+POdXeY6aZdlFeDgMq+4C+IS/84 MfKuoiuBifB0ZEMEij16wJ9xuFGKHDvm2c0Pd+R0RP2Ba7fYKKljzYoLSlkcMjB+seFg 8ukv9naZs4BvrlUxuy4RLlyqjr6xed9GZJqYIyLNRTSNpOz5RwVX1X8mTNVa6UPgljtj fh3Wh4aJAYgMCmslONXJXA4Ksnk+INVRkHs+npXUB9dsBaO3bQ6TMudILn6VCTK1Ttmj cky4aUzy8IgChPicaLK5fOWoIgvtSjamBmiyzo5Xc6PHu4Jk6taz3i0AojPneUzRds+5 NoVQ== X-Gm-Message-State: APzg51DB+gi+JdRUpNtk+4WGsBhjOD05JWiK9s0q21j+MJs69EFLjNS0 Zox2r2DCu6+gqjQbByZhzCSt3Q== X-Google-Smtp-Source: ANB0VdZSVIui8G42xLtcMlXp/qJEYw0K+UBr9Nin36l4n7dfa952V5ihVn/gOF9dOLFaC4QjRY0E8Q== X-Received: by 2002:a25:6648:: with SMTP id z8-v6mr3606083ybm.87.1537462173878; Thu, 20 Sep 2018 09:49:33 -0700 (PDT) Received: from bzwang.cnc.corp.google.com ([2620:0:1013:11:6f9e:dcbe:41ef:a61]) by smtp.gmail.com with ESMTPSA id e126-v6sm6332688ywf.72.2018.09.20.09.49.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 09:49:32 -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 Subject: [PATCH v2 4/7] drm/msm/dpu: Change _dpu_crtc_power_enable to void Date: Thu, 20 Sep 2018 12:49:21 -0400 Message-Id: <20180920164924.225847-5-bzwang@chromium.org> X-Mailer: git-send-email 2.19.0.444.g18242da7ef-goog In-Reply-To: <20180920164924.225847-1-bzwang@chromium.org> References: <20180920164924.225847-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 --- 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 a9adb16eac6f..648d77c41c3e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -59,37 +59,16 @@ static inline struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) ->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) @@ -822,14 +801,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)