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: 100665 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp395073qge; Mon, 29 May 2017 08:46:47 -0700 (PDT) X-Received: by 10.84.135.129 with SMTP id 1mr77216885plj.57.1496072806833; Mon, 29 May 2017 08:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496072806; cv=none; d=google.com; s=arc-20160816; b=tgnkrhncpU3aJyT3fRakr3vtk1LACtm0SzA50DtGUvCipwBh6O6Vpf1NwhjkGyA4md ArolvTcEijR4D4QnMxOt4aG5hHuRRRmrjwFNbucJi05JrBXlT4KXqTLZNrk9oNtp+UUt CUFOOaPzbf6MyoMKPJfTZtdzDW4m2mw/hQ8ao6AoetH8Vs8xYryF0JCyvRaF6CGvmsPq RyLxkVQe6+3INq2Yqu4eFO9CTWxodn1igwns/RtvCSH7iqOtUn+LjHDkibvqcFYPdTTW icZa7YR5Fi7zCDWKwiRQynRrllr97JSK26amEz5v9CGlNI04dNK8YulzPIrDCGKacVW2 7r4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature:arc-authentication-results; bh=K/uWNx3F/MXl+yvFxtAp8QUqo6J8cCy6nXjOC0BY+KA=; b=MRHjCKVR+0uImEpI7UijPwHwya8RPi8i8a4dhe8lBPAvr58aQN0T7uNaMSZpx6tYrK ewAf9zotZ0syeE7G56bqF7c3dPY7szB68tR0doGQO8JkAjrKuoX99n8PMCDuGRS0X4Of xTn58KkQCLFL9cgW1IULHLotk92WKy43FnMgZYKeeYlznvCyRgZAOm9fLKKl+4/5+RYg PLI7rDGGCf9+qXWYZ0rsmRF21rrWVF+NVDk+2Gm/mjSHGA5gzybnac/2JoFsDEqQvmbR 6uLij0lR4tvAnBLHzhspa/Uf+RwxypDLZkuiYFcnc2yTVAmi63IWXFnNX8Ng0ZcKbo4+ FBbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o82si10870846pfi.82.2017.05.29.08.46.46; Mon, 29 May 2017 08:46:46 -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; dkim=fail header.i=@linaro.org; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751239AbdE2Pqe (ORCPT + 25 others); Mon, 29 May 2017 11:46:34 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36962 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187AbdE2Pqb (ORCPT ); Mon, 29 May 2017 11:46:31 -0400 Received: by mail-wm0-f45.google.com with SMTP id d127so64528411wmf.0 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=IhYu1gwQ/2yibndnrO9fR8LPGqSYKPt02uc+PWFsjzPqPJrnfmgaciWHuvUgHXRz7F xK5Y0EwC1/4GNGFFuJ+xHmApBDmyijmty8U4aRo5n2uAfS8/VyZ3vUS9NWnCadoyIVGj 8Z4aTZUsXNQNDZMJdL2zwVez+ErucuQDjIzbS2k/+3jo0Xp1HqfvLl2e0vEDBopChilp FrZNhjgj6b0CuZXZKpKWKoOTtLFFO2w249r3ehFEM+tX38OWDgM0EOQdXje8b3VEn93l slL+ChJhZ7dYkqtKMpSEzCSgp0ClWDwwAHh6jjbrE7Vh9uk73VKMt3ISrVXMMoePH6mI JJ6Q== X-Gm-Message-State: AODbwcAo30NbVbaBqTUJiA7Yniqg64y0VkXJkn+oqoj9WaXRemMAjj+o 0l3ZFZtFwYiW+fCpHFJE8jqA 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 Cc: Benjamin Gaignard , Rob Clark , David Airlie , 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 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> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.9.1 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; }