From patchwork Thu Aug 20 10:43:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248022 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1233742ils; Thu, 20 Aug 2020 03:45:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrKqtFIXnzYmm9YZp7Mmeobj37MMeAvZvOo+v+/CLo1vF7uVrZ77QhXzX0TwL1ROe45IPS X-Received: by 2002:a17:906:5ac8:: with SMTP id x8mr2563128ejs.486.1597920311999; Thu, 20 Aug 2020 03:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597920311; cv=none; d=google.com; s=arc-20160816; b=FyrCueVB6if8HEVT1HSpXB5cQbhcww0eJpeOEtXry15YswKai0rcSohpb9VcvogQH6 O0OqKRsD7RZJPS2uBkANF1wCu+mn6kISxd8y7hEXKz5/v+Fzl8d3uOgrE4DpQK++AC7w UR06EfRIKzNsaLbpKtMcZqnM02N/QE3eUnW/YdGYh8wyIb5J2kKhZzSp2YHljxsf8+qf Feem5qJQNnhlI6KVjH3+21GudvzPKOcbsUjw97LYF8XAjXmyCcpBvdZbyQF3h5qdw7O+ SxCvuaeuMNOE1D9acV9FviQPzz3sdR1qlmubELYiGArRh2UncQcC66kIp14BIQCbkxjD NMlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DpgTiEjgRiD0zhPSebj/TpHieKoL8i50gdOLCJBlmJ4=; b=TYAQID/QqnmbUVKjY9HPkcGRi4Z6H9HqXnBqAy0uI8P/C0ymFEUa+IJ+Bt+gHQBVvF rU0yRFuIZZtTP9QVfW+sMgFYjKoJanOO69IUatnorCjRz61JYQGpSBz7hCCuuV0zYMb5 OLSAFaIUoDjVdHyJ4AZsB2js033umlW6xMp03Q5vYowL/7EfFvxm/1TaE/7t+omcGv0f rLw3A7+epwsQt5CfIFf8T8DTO8V9F7L/ALLcy0HXDAv0MzmKTPZydi5vGEliupw3pD4A jTbXGteTq/pbQwTvKz0niWv6vuyX64A6yqIiSia1wHhur8s15BmG6oN1MpvqaA5HKmyX 1fCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OSGUAITJ; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zn8si1087475ejb.70.2020.08.20.03.45.11; Thu, 20 Aug 2020 03:45:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OSGUAITJ; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731883AbgHTKot (ORCPT + 10 others); Thu, 20 Aug 2020 06:44:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731892AbgHTKoh (ORCPT ); Thu, 20 Aug 2020 06:44:37 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B8B8C061349 for ; Thu, 20 Aug 2020 03:44:25 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id f5so842935plr.9 for ; Thu, 20 Aug 2020 03:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DpgTiEjgRiD0zhPSebj/TpHieKoL8i50gdOLCJBlmJ4=; b=OSGUAITJhbJJ52/Uazu0MwC68AnxFTVFBm2nryW7rIRv2Iehs4ErKkFDB4CvW/yifJ ELaRK72bwMfqIokp6jb3YgnqZhSeHNDQzg025eNwaeahDVZfjtOHufpZEQ4EPZA58LRi wjwfNwQUwHsjcucCKoKS/aPzEGZSL86XD6dlQ/mSWuZKipvSC8SbXtbH0VffOwrmBBS9 N+TkFN4uny2gtdDnktp1L5R0IDe52JqLCbLdiILjK+3LPgtibESdOcwz3gLKy5O87faY np1FWs1hsGNXwSzhURE1Okz9dQm9zvIw5pJ4DhKC7mK3BqIx6pBnupcYs8m0KuS4XwTF 7ZTw== 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=DpgTiEjgRiD0zhPSebj/TpHieKoL8i50gdOLCJBlmJ4=; b=bPFRUyZLDW/lDAvcyM2pKIIuv9/5QHULuiNDmSpa21iPzjz9O2Lhd7NI8Bo8aLNs31 YgS0hfsg9KdtyvYqnTOfc3CaFKLI+LrBwzo7uhi52j0Yr41nCDJKxW52fA21Bqgso7Kl Ty0JgtpbOkG59+W4GMe55h3jKsV26DQwX57NhfI9gj7828pVBaIGKhfCm2a137FUvNt2 RH/z7VwU/JRQ1OjxFkIGmcmDmD1YWO7TdHDB7/S4uRC8lCIz7NrXq/bGvNm+0v4GrIsm v9Ul5b7CS07YxcL2vQVMBq1fAgL7t9jxXZ0ROYR5JHqG4tGXFrPst7X86mDpLh6UlTI9 cBUQ== X-Gm-Message-State: AOAM5336YJchQhBpDE7QNlm+lSFvFAupOhgMvcB8Zrc4TUObhrLV0nCP dvk4AQPYrChTvtWprUj3tWX50w== X-Received: by 2002:a17:90b:238d:: with SMTP id mr13mr1928786pjb.132.1597920264919; Thu, 20 Aug 2020 03:44:24 -0700 (PDT) Received: from localhost ([122.172.43.13]) by smtp.gmail.com with ESMTPSA id e7sm2145009pgn.64.2020.08.20.03.44.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2020 03:44:24 -0700 (PDT) From: Viresh Kumar To: rnayak@codeaurora.org, Rob Clark , Sean Paul Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] drm/msm: Unconditionally call dev_pm_opp_of_remove_table() Date: Thu, 20 Aug 2020 16:13:52 +0530 Message-Id: <4ca1dd576f016d49e57b679d0921a268b4a7fa62.1597919647.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org dev_pm_opp_of_remove_table() doesn't report any errors when it fails to find the OPP table with error -ENODEV (i.e. OPP table not present for the device). And we can call dev_pm_opp_of_remove_table() unconditionally here. Signed-off-by: Viresh Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 10 +++------- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 1 - drivers/gpu/drm/msm/dsi/dsi_host.c | 8 ++------ 3 files changed, 5 insertions(+), 14 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index c0a4d4e16d82..1bd67ba1bf1f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1010,9 +1010,7 @@ static int dpu_bind(struct device *dev, struct device *master, void *data) return PTR_ERR(dpu_kms->opp_table); /* OPP table is optional */ ret = dev_pm_opp_of_add_table(dev); - if (!ret) { - dpu_kms->has_opp_table = true; - } else if (ret != -ENODEV) { + if (ret != -ENODEV) { dev_err(dev, "invalid OPP table in device tree\n"); dev_pm_opp_put_clkname(dpu_kms->opp_table); return ret; @@ -1037,8 +1035,7 @@ static int dpu_bind(struct device *dev, struct device *master, void *data) priv->kms = &dpu_kms->base; return ret; err: - if (dpu_kms->has_opp_table) - dev_pm_opp_of_remove_table(dev); + dev_pm_opp_of_remove_table(dev); dev_pm_opp_put_clkname(dpu_kms->opp_table); return ret; } @@ -1056,8 +1053,7 @@ static void dpu_unbind(struct device *dev, struct device *master, void *data) if (dpu_kms->rpm_enabled) pm_runtime_disable(&pdev->dev); - if (dpu_kms->has_opp_table) - dev_pm_opp_of_remove_table(dev); + dev_pm_opp_of_remove_table(dev); dev_pm_opp_put_clkname(dpu_kms->opp_table); } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h index e140cd633071..8295979a7165 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h @@ -129,7 +129,6 @@ struct dpu_kms { bool rpm_enabled; struct opp_table *opp_table; - bool has_opp_table; struct dss_module_power mp; diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index b17ac6c27554..288f9df06ea2 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -113,7 +113,6 @@ struct msm_dsi_host { struct clk *byte_intf_clk; struct opp_table *opp_table; - bool has_opp_table; u32 byte_clk_rate; u32 pixel_clk_rate; @@ -1891,9 +1890,7 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) return PTR_ERR(msm_host->opp_table); /* OPP table is optional */ ret = dev_pm_opp_of_add_table(&pdev->dev); - if (!ret) { - msm_host->has_opp_table = true; - } else if (ret != -ENODEV) { + if (ret != -ENODEV) { dev_err(&pdev->dev, "invalid OPP table in device tree\n"); dev_pm_opp_put_clkname(msm_host->opp_table); return ret; @@ -1934,8 +1931,7 @@ void msm_dsi_host_destroy(struct mipi_dsi_host *host) mutex_destroy(&msm_host->cmd_mutex); mutex_destroy(&msm_host->dev_mutex); - if (msm_host->has_opp_table) - dev_pm_opp_of_remove_table(&msm_host->pdev->dev); + dev_pm_opp_of_remove_table(&msm_host->pdev->dev); dev_pm_opp_put_clkname(msm_host->opp_table); pm_runtime_disable(&msm_host->pdev->dev); }