From: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 04/15] drm: msm: use devm_of_platform_populate() Date: Mon, 29 May 2017 17:45:52 +0200 [thread overview] Message-ID: <1496072763-31209-5-git-send-email-benjamin.gaignard@linaro.org> (raw) In-Reply-To: <1496072763-31209-1-git-send-email-benjamin.gaignard@linaro.org> Use devm_of_platform_populate() to simplify driver code. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> CC: Rob Clark <robdclark@gmail.com> CC: David Airlie <airlied@linux.ie> CC: linux-arm-msm@vger.kernel.org CC: dri-devel@lists.freedesktop.org CC: freedreno@lists.freedesktop.org CC: linux-kernel@vger.kernel.org --- drivers/gpu/drm/msm/msm_drv.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 87b5695..545fb6f 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -969,7 +969,7 @@ static int add_display_components(struct device *dev, * to our components list. */ if (of_device_is_compatible(dev->of_node, "qcom,mdss")) { - ret = of_platform_populate(dev->of_node, NULL, NULL, dev); + ret = devm_of_platform_populate(dev); if (ret) { dev_err(dev, "failed to populate children devices\n"); return ret; @@ -978,7 +978,6 @@ static int add_display_components(struct device *dev, mdp_dev = device_find_child(dev, NULL, compare_name_mdp); if (!mdp_dev) { dev_err(dev, "failed to find MDSS MDP node\n"); - of_platform_depopulate(dev); return -ENODEV; } @@ -992,11 +991,7 @@ static int add_display_components(struct device *dev, mdp_dev = dev; } - ret = add_components_mdp(mdp_dev, matchptr); - if (ret) - of_platform_depopulate(dev); - - return ret; + return add_components_mdp(mdp_dev, matchptr); } /* @@ -1072,7 +1067,6 @@ static int msm_pdev_probe(struct platform_device *pdev) static int msm_pdev_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &msm_drm_ops); - of_platform_depopulate(&pdev->dev); return 0; } -- 1.9.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Gaignard <benjamin.gaignard@linaro.org> To: unlisted-recipients:; (no To-header on input) Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>, Rob Clark <robdclark@gmail.com>, David Airlie <airlied@linux.ie>, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/15] drm: msm: use devm_of_platform_populate() Date: Mon, 29 May 2017 17:45:52 +0200 [thread overview] Message-ID: <1496072763-31209-5-git-send-email-benjamin.gaignard@linaro.org> (raw) In-Reply-To: <1496072763-31209-1-git-send-email-benjamin.gaignard@linaro.org> Use devm_of_platform_populate() to simplify driver code. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> CC: Rob Clark <robdclark@gmail.com> CC: David Airlie <airlied@linux.ie> CC: linux-arm-msm@vger.kernel.org CC: dri-devel@lists.freedesktop.org CC: freedreno@lists.freedesktop.org CC: linux-kernel@vger.kernel.org --- drivers/gpu/drm/msm/msm_drv.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 87b5695..545fb6f 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -969,7 +969,7 @@ static int add_display_components(struct device *dev, * to our components list. */ if (of_device_is_compatible(dev->of_node, "qcom,mdss")) { - ret = of_platform_populate(dev->of_node, NULL, NULL, dev); + ret = devm_of_platform_populate(dev); if (ret) { dev_err(dev, "failed to populate children devices\n"); return ret; @@ -978,7 +978,6 @@ static int add_display_components(struct device *dev, mdp_dev = device_find_child(dev, NULL, compare_name_mdp); if (!mdp_dev) { dev_err(dev, "failed to find MDSS MDP node\n"); - of_platform_depopulate(dev); return -ENODEV; } @@ -992,11 +991,7 @@ static int add_display_components(struct device *dev, mdp_dev = dev; } - ret = add_components_mdp(mdp_dev, matchptr); - if (ret) - of_platform_depopulate(dev); - - return ret; + return add_components_mdp(mdp_dev, matchptr); } /* @@ -1072,7 +1067,6 @@ static int msm_pdev_probe(struct platform_device *pdev) static int msm_pdev_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &msm_drm_ops); - of_platform_depopulate(&pdev->dev); return 0; } -- 1.9.1
next prev parent reply other threads:[~2017-05-29 15:45 UTC|newest] Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-05-29 15:45 [PATCH 00/15] make more driver use devm_of_platform_populate() Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-29 15:45 ` [PATCH 01/15] iio: adc: stm32: " Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-29 16:00 ` Jonathan Cameron 2017-05-29 16:00 ` Jonathan Cameron 2017-05-29 16:03 ` Fabrice Gasnier 2017-05-29 16:03 ` Fabrice Gasnier 2017-05-29 15:45 ` [PATCH 02/15] iio: dac: " Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-29 16:10 ` Fabrice Gasnier 2017-05-29 16:10 ` Fabrice Gasnier 2017-05-29 15:45 ` [PATCH 03/15] drm: zte: " Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-06-05 1:59 ` Shawn Guo 2017-06-05 1:59 ` Shawn Guo 2017-05-29 15:45 ` Benjamin Gaignard [this message] 2017-05-29 15:45 ` [PATCH 04/15] drm: msm: " Benjamin Gaignard 2017-05-29 15:45 ` [PATCH 05/15] mfd: stm32-timers: use devm_of_platform_populate Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-30 9:29 ` Lee Jones 2017-05-30 9:29 ` Lee Jones 2017-05-29 15:45 ` [PATCH 06/15] mfd: atmel: use devm_of_platform_populate() Benjamin Gaignard 2017-05-30 9:30 ` Lee Jones 2017-05-29 15:45 ` [PATCH 07/15] mfd: cros_ec: " Benjamin Gaignard 2017-05-30 9:30 ` Lee Jones 2017-05-29 15:45 ` [PATCH 08/15] mfd: exynos: " Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-29 15:45 ` Benjamin Gaignard 2017-05-30 9:31 ` Lee Jones 2017-05-30 9:31 ` Lee Jones 2017-05-29 15:45 ` [PATCH 09/15] mfd: fsl-imx25: " Benjamin Gaignard 2017-05-30 9:31 ` Lee Jones 2017-05-29 15:45 ` [PATCH 10/15] mfd: motorola-cpcap: " Benjamin Gaignard 2017-05-29 22:07 ` Andy Shevchenko 2017-05-30 7:29 ` Benjamin Gaignard 2017-05-30 10:03 ` Lee Jones 2017-05-30 10:46 ` Andy Shevchenko 2017-05-30 10:09 ` Lee Jones 2017-05-29 15:45 ` [PATCH 11/15] mfd: palmas: " Benjamin Gaignard 2017-05-30 9:31 ` Lee Jones 2017-05-29 15:46 ` [PATCH 12/15] mfd: qcom-spmi-pmic: " Benjamin Gaignard 2017-05-30 9:32 ` Lee Jones 2017-05-29 15:46 ` [PATCH 13/15] mfd: smsc-ece: " Benjamin Gaignard 2017-05-30 9:32 ` Lee Jones 2017-05-29 15:46 ` [PATCH 14/15] sound: stm32: " Benjamin Gaignard 2017-05-29 15:46 ` Benjamin Gaignard 2017-05-29 15:46 ` Benjamin Gaignard 2017-05-30 9:03 ` Olivier MOYSAN 2017-05-30 9:03 ` Olivier MOYSAN 2017-05-30 9:03 ` Olivier MOYSAN 2017-05-29 15:46 ` [PATCH 15/15] media: exynos4-is: " Benjamin Gaignard 2017-05-29 15:46 ` Benjamin Gaignard 2017-05-29 15:46 ` Benjamin Gaignard 2017-05-29 15:46 ` Benjamin Gaignard
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=1496072763-31209-5-git-send-email-benjamin.gaignard@linaro.org \ --to=benjamin.gaignard@linaro.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 \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.