From: Douglas Anderson <dianders@chromium.org>
To: Rob Herring <robh+dt@kernel.org>, Rob Clark <robdclark@gmail.com>,
Sean Paul <sean@poorly.run>, Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
freedreno@lists.freedesktop.org, devicetree@vger.kernel.org,
Douglas Anderson <dianders@chromium.org>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/9] drm/msm: Use the devm variant of of_platform_populate()
Date: Fri, 10 Jul 2020 16:02:16 -0700 [thread overview]
Message-ID: <20200710160131.1.I3f7862adcb0806d56a8c7260857d887100b06b41@changeid> (raw)
In-Reply-To: <20200710230224.2265647-1-dianders@chromium.org>
Let's save ourselves some hassle and use the devm variant of
of_platform_populate() do we don't need to worry about manually
depopulating.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
drivers/gpu/drm/msm/msm_drv.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index f6ce40bf3699..78b09fde9e29 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -1208,7 +1208,7 @@ static int add_display_components(struct device *dev,
if (of_device_is_compatible(dev->of_node, "qcom,mdss") ||
of_device_is_compatible(dev->of_node, "qcom,sdm845-mdss") ||
of_device_is_compatible(dev->of_node, "qcom,sc7180-mdss")) {
- ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
+ ret = devm_of_platform_populate(dev);
if (ret) {
DRM_DEV_ERROR(dev, "failed to populate children devices\n");
return ret;
@@ -1217,7 +1217,6 @@ static int add_display_components(struct device *dev,
mdp_dev = device_find_child(dev, NULL, compare_name_mdp);
if (!mdp_dev) {
DRM_DEV_ERROR(dev, "failed to find MDSS MDP node\n");
- of_platform_depopulate(dev);
return -ENODEV;
}
@@ -1232,8 +1231,6 @@ static int add_display_components(struct device *dev,
}
ret = add_components_mdp(mdp_dev, matchptr);
- if (ret)
- of_platform_depopulate(dev);
return ret;
}
@@ -1300,30 +1297,21 @@ static int msm_pdev_probe(struct platform_device *pdev)
ret = add_gpu_components(&pdev->dev, &match);
if (ret)
- goto fail;
+ return ret;
/* on all devices that I am aware of, iommu's which can map
* any address the cpu can see are used:
*/
ret = dma_set_mask_and_coherent(&pdev->dev, ~0);
if (ret)
- goto fail;
-
- ret = component_master_add_with_match(&pdev->dev, &msm_drm_ops, match);
- if (ret)
- goto fail;
-
- return 0;
+ return ret;
-fail:
- of_platform_depopulate(&pdev->dev);
- return ret;
+ return component_master_add_with_match(&pdev->dev, &msm_drm_ops, match);
}
static int msm_pdev_remove(struct platform_device *pdev)
{
component_master_del(&pdev->dev, &msm_drm_ops);
- of_platform_depopulate(&pdev->dev);
return 0;
}
--
2.27.0.383.g050319c2ae-goog
next prev parent reply other threads:[~2020-07-10 23:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 23:02 [PATCH 0/9] drm/msm: Avoid possible infinite probe deferral and speed booting Douglas Anderson
2020-07-10 23:02 ` Douglas Anderson [this message]
2020-07-10 23:02 ` [PATCH 2/9] dt-bindings: msm/dpu: Add simple-bus to dpu bindings Douglas Anderson
2020-07-10 23:02 ` [PATCH 3/9] dt-bindings: msm/mdp5: " Douglas Anderson
2020-07-10 23:02 ` [PATCH 4/9] drm/msm: Avoid manually populating our children if "simple-bus" is there Douglas Anderson
2020-07-10 23:02 ` [PATCH 5/9] arm64: dts: qcom: sc7180: Add "simple-bus" to our mdss node Douglas Anderson
2020-07-10 23:02 ` [PATCH 6/9] arm64: dts: qcom: sdm845: " Douglas Anderson
2020-07-10 23:02 ` [PATCH 7/9] arm64: dts: qcom: msm8916: " Douglas Anderson
2020-07-10 23:02 ` [PATCH 8/9] arm64: dts: qcom: msm8996: " Douglas Anderson
2020-07-10 23:02 ` [PATCH 9/9] ARM: dts: qcom: msm8974: " Douglas Anderson
2020-07-13 14:11 ` [PATCH 0/9] drm/msm: Avoid possible infinite probe deferral and speed booting Rob Herring
2020-07-13 14:58 ` [Freedreno] " Jeffrey Hugo
2020-07-13 15:08 ` Doug Anderson
2020-07-13 20:25 ` Rob Herring
2020-07-13 21:32 ` Rob Clark
2020-07-13 23:50 ` Doug Anderson
2020-07-14 16:32 ` [Freedreno] " Jeffrey Hugo
2020-07-14 22:13 ` Rob Herring
2020-07-14 22:52 ` Bjorn Andersson
2020-07-15 17:30 ` Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200710160131.1.I3f7862adcb0806d56a8c7260857d887100b06b41@changeid \
--to=dianders@chromium.org \
--cc=agross@kernel.org \
--cc=airlied@linux.ie \
--cc=bjorn.andersson@linaro.org \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=robh+dt@kernel.org \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).