Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3287063yba; Tue, 23 Apr 2019 00:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyf1CXCvpIiUFEOd2kjx1uAIlUpcRBhazbin1Hes9PwNFvQB9hpqVyRlKGpJ/T67DWPmQW X-Received: by 2002:a17:902:e110:: with SMTP id cc16mr24129699plb.147.1556005475232; Tue, 23 Apr 2019 00:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556005475; cv=none; d=google.com; s=arc-20160816; b=VBSAIeDzFT0K9e/2/MbOLAIO7Y4bSDYU9hIgfoSEcZpUkfNcpzVzsPXcEBbxgdFKky wJOu1F1vn2cVO3U4IsNyZ2E1YhU5YK34tvT8qAp8SWAQ/BG15E55qVw1nDHd1ETohqSc r+YYcjHp0cDIRGR/bJ6Q5hP+0S3QLv207fAn1s/fSiXCWqMlMNnyU5QJW1UBYTqzllLT MRzHyK8TWUSTrCyPiKdFZoTAWAif+o7psUt1nh7cHSfCwyVlCbAiVAZIABT4JYUk9Kde kY0Epxcb2vwf6Z8DYjQtlLEf7sJ3AegXsezGJ+VQm/wyLU3RIu4zFLdP+y+APGnt48Ee YaWw== 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; bh=Pn8Z1/PpurKNA8va7QMB1IylOCcblT3prelD9doN/B8=; b=PHT5yuDllaBYdfDajIubjHUSBX4IJ+q5W9zYlVYbEmJNdL2/G8hktX5hYVur/QqKbD UQLwED4E6WiRjUtgpVnGMEr/8xU9iax36Ie9UkVWHciXGPDSSww09HqyWo7KtYEnwocd V/tD3eH0n+bX/jcgmBVSD1qKBJTfuPHJrCzEYzlvpG0K+dBh2O2q6JQfP4KWGbbBLBk+ PgJNtqe1jht70Q4AsfChCdDMM2t53pYOoOQ3rEvL8lzRqYfN+pIfEskYFUB+0/Xu7pMY 97MjGVSG4gg3DZF7vqNC1vgBmOTzqJzcLfaqWW0Fgrma6QD2nPd2ys7on9D/e+XweqD7 qKNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si15771795pld.269.2019.04.23.00.44.20; Tue, 23 Apr 2019 00:44:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726525AbfDWHkQ (ORCPT + 99 others); Tue, 23 Apr 2019 03:40:16 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6678 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725935AbfDWHkQ (ORCPT ); Tue, 23 Apr 2019 03:40:16 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C4F419AD94D21A52839F; Tue, 23 Apr 2019 15:40:12 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Apr 2019 15:40:05 +0800 From: Kefeng Wang To: CC: Masahiro Yamada , Kefeng Wang , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , , Subject: [PATCH next 05/25] drm/msm: Use dev_get_drvdata() Date: Tue, 23 Apr 2019 15:50:00 +0800 Message-ID: <20190423075020.173734-6-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190423075020.173734-1-wangkefeng.wang@huawei.com> References: <20190423075020.173734-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using dev_get_drvdata directly. Cc: Rob Clark Cc: Sean Paul Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Kefeng Wang --- drivers/gpu/drm/msm/adreno/adreno_device.c | 6 ++---- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 13 +++++-------- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 6 ++---- drivers/gpu/drm/msm/dsi/dsi_host.c | 6 ++---- drivers/gpu/drm/msm/msm_drv.c | 3 +-- drivers/gpu/drm/msm/msm_gpu.c | 6 +++--- 6 files changed, 15 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c index 714ed6505e47..13802af8294c 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -412,16 +412,14 @@ static const struct of_device_id dt_match[] = { #ifdef CONFIG_PM static int adreno_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct msm_gpu *gpu = platform_get_drvdata(pdev); + struct msm_gpu *gpu = dev_get_drvdata(dev); return gpu->funcs->pm_resume(gpu); } static int adreno_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct msm_gpu *gpu = platform_get_drvdata(pdev); + struct msm_gpu *gpu = dev_get_drvdata(dev); return gpu->funcs->pm_suspend(gpu); } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 885bf88afa3e..0154eb9b343f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1036,16 +1036,15 @@ static int dpu_bind(struct device *dev, struct device *master, void *data) static void dpu_unbind(struct device *dev, struct device *master, void *data) { - struct platform_device *pdev = to_platform_device(dev); - struct dpu_kms *dpu_kms = platform_get_drvdata(pdev); + struct dpu_kms *dpu_kms = dev_get_drvdata(dev); struct dss_module_power *mp = &dpu_kms->mp; msm_dss_put_clk(mp->clk_config, mp->num_clk); - devm_kfree(&pdev->dev, mp->clk_config); + devm_kfree(dev, mp->clk_config); mp->num_clk = 0; if (dpu_kms->rpm_enabled) - pm_runtime_disable(&pdev->dev); + pm_runtime_disable(dev); } static const struct component_ops dpu_ops = { @@ -1067,8 +1066,7 @@ static int dpu_dev_remove(struct platform_device *pdev) static int __maybe_unused dpu_runtime_suspend(struct device *dev) { int rc = -1; - struct platform_device *pdev = to_platform_device(dev); - struct dpu_kms *dpu_kms = platform_get_drvdata(pdev); + struct dpu_kms *dpu_kms = dev_get_drvdata(dev); struct drm_device *ddev; struct dss_module_power *mp = &dpu_kms->mp; @@ -1088,8 +1086,7 @@ static int __maybe_unused dpu_runtime_suspend(struct device *dev) static int __maybe_unused dpu_runtime_resume(struct device *dev) { int rc = -1; - struct platform_device *pdev = to_platform_device(dev); - struct dpu_kms *dpu_kms = platform_get_drvdata(pdev); + struct dpu_kms *dpu_kms = dev_get_drvdata(dev); struct drm_encoder *encoder; struct drm_device *ddev; struct dss_module_power *mp = &dpu_kms->mp; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 97179bec8902..8f7a01d7a663 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -1063,8 +1063,7 @@ static int mdp5_dev_remove(struct platform_device *pdev) static __maybe_unused int mdp5_runtime_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct mdp5_kms *mdp5_kms = platform_get_drvdata(pdev); + struct mdp5_kms *mdp5_kms = dev_get_drvdata(dev); DBG(""); @@ -1073,8 +1072,7 @@ static __maybe_unused int mdp5_runtime_suspend(struct device *dev) static __maybe_unused int mdp5_runtime_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct mdp5_kms *mdp5_kms = platform_get_drvdata(pdev); + struct mdp5_kms *mdp5_kms = dev_get_drvdata(dev); DBG(""); diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 610183db1daf..4a158c41ef30 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -485,8 +485,7 @@ static void dsi_bus_clk_disable(struct msm_dsi_host *msm_host) int msm_dsi_runtime_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct msm_dsi *msm_dsi = platform_get_drvdata(pdev); + struct msm_dsi *msm_dsi = dev_get_drvdata(dev); struct mipi_dsi_host *host = msm_dsi->host; struct msm_dsi_host *msm_host = to_msm_dsi_host(host); @@ -500,8 +499,7 @@ int msm_dsi_runtime_suspend(struct device *dev) int msm_dsi_runtime_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct msm_dsi *msm_dsi = platform_get_drvdata(pdev); + struct msm_dsi *msm_dsi = dev_get_drvdata(dev); struct mipi_dsi_host *host = msm_dsi->host; struct msm_dsi_host *msm_host = to_msm_dsi_host(host); diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 4697d854b827..9faa9290421a 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -251,8 +251,7 @@ static int vblank_ctrl_queue_work(struct msm_drm_private *priv, static int msm_drm_uninit(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct drm_device *ddev = platform_get_drvdata(pdev); + struct drm_device *ddev = dev_get_drvdata(dev); struct msm_drm_private *priv = ddev->dev_private; struct msm_kms *kms = priv->kms; struct msm_mdss *mdss = priv->mdss; diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 10babd18e286..b8d154d6470f 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -35,7 +35,7 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) { - struct msm_gpu *gpu = platform_get_drvdata(to_platform_device(dev)); + struct msm_gpu *gpu = dev_get_drvdata(dev); struct dev_pm_opp *opp; opp = devfreq_recommended_opp(dev, freq, flags); @@ -56,7 +56,7 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq, static int msm_devfreq_get_dev_status(struct device *dev, struct devfreq_dev_status *status) { - struct msm_gpu *gpu = platform_get_drvdata(to_platform_device(dev)); + struct msm_gpu *gpu = dev_get_drvdata(dev); ktime_t time; if (gpu->funcs->gpu_get_freq) @@ -75,7 +75,7 @@ static int msm_devfreq_get_dev_status(struct device *dev, static int msm_devfreq_get_cur_freq(struct device *dev, unsigned long *freq) { - struct msm_gpu *gpu = platform_get_drvdata(to_platform_device(dev)); + struct msm_gpu *gpu = dev_get_drvdata(dev); if (gpu->funcs->gpu_get_freq) *freq = gpu->funcs->gpu_get_freq(gpu); -- 2.20.1