From patchwork Mon May 29 15:45:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9753385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E1DE76038E for ; Mon, 29 May 2017 15:46:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5E50237A5 for ; Mon, 29 May 2017 15:46:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CAD3327F86; Mon, 29 May 2017 15:46:36 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 77C87237A5 for ; Mon, 29 May 2017 15:46:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EA0B289A0E; Mon, 29 May 2017 15:46:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0BD8B89650 for ; Mon, 29 May 2017 15:46:32 +0000 (UTC) Received: by mail-wm0-x22b.google.com with SMTP id 7so60657412wmo.1 for ; Mon, 29 May 2017 08:46:31 -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; bh=K/uWNx3F/MXl+yvFxtAp8QUqo6J8cCy6nXjOC0BY+KA=; b=MK0h+2cktcPRlEkdFf0dak2fiTFGAyc/5BtIlEqUftzWNCzqNuiRe6GnhUg74L2m1S uRriaE6NvIgD7DhYnBkNoJnFyQjbWu7mZpWS/qE71JdIEEL5EsVnfD+cRRTvV5/md8iw wf1pFVC6+gGTPHUXm5pnSqfy0BQH1tOVNnNx0= 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; bh=K/uWNx3F/MXl+yvFxtAp8QUqo6J8cCy6nXjOC0BY+KA=; b=GNuuz9/fkAKMRaMsL9eO9iySz2JVS/tv/PUt73vhE509JNsfhfwFRZGUYqpUHj1anP x/a1Q2+f/CfBqxe3CsPeai68hzYhMLyIA0RQJ72rJb++qRQNvbVPrmf9MECw5yHeHBVb TZoKnTcQU8ni1XSqIWcAPYl1R7CSq3s1hu29lPatpFmB4wC9M6XZFVYHrE6wG1ASpXYw mlUCP0fP7I3kANHNpfahs6bcq6e22sjZMu60XuFMxnG4XApuDb/6/5dz5CDsxruOX747 LNaGHAnorn+dKeo0X7GJcx7QUYAXH9A1GUflo0PvTgQ2nFuyZc1gxkhtUM7Wzk2c2uHQ 3u6Q== X-Gm-Message-State: AODbwcA8o0M0wfo8/wtstSo8AazIfGBMW6vQmX8kMRGmtuKJqbSC6s/U N756n1pdAYn6PLDo X-Received: by 10.223.134.22 with SMTP id 22mr10224155wrv.182.1496072790587; Mon, 29 May 2017 08:46:30 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.227.188]) by smtp.gmail.com with ESMTPSA id 79sm13210721wmo.13.2017.05.29.08.46.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 May 2017 08:46:30 -0700 (PDT) From: Benjamin Gaignard To: Subject: [PATCH 04/15] drm: msm: use devm_of_platform_populate() Date: Mon, 29 May 2017 17:45:52 +0200 Message-Id: <1496072763-31209-5-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1496072763-31209-1-git-send-email-benjamin.gaignard@linaro.org> References: <1496072763-31209-1-git-send-email-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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use devm_of_platform_populate() to simplify driver code. Signed-off-by: Benjamin Gaignard CC: Rob Clark CC: David Airlie 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; }