From patchwork Fri Feb 24 16:14:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 94491 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp758663qgi; Fri, 24 Feb 2017 08:15:26 -0800 (PST) X-Received: by 10.84.229.77 with SMTP id d13mr4894120pln.177.1487952926034; Fri, 24 Feb 2017 08:15:26 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id e17si7698272pgg.408.2017.02.24.08.15.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2017 08:15:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A4996ECC8; Fri, 24 Feb 2017 16:14:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id E50416ECC5 for ; Fri, 24 Feb 2017 16:14:49 +0000 (UTC) Received: by mail-wm0-x232.google.com with SMTP id v186so18293752wmd.0 for ; Fri, 24 Feb 2017 08:14:49 -0800 (PST) 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=punOLD+8HsaTHtF7kvu4oRzCWSlLACsZVbrNn6qfWGo=; b=b6riFpZz+gof/nmYrFB1Zjfd3Z5DtL1qqlFA+OlEUsEPlPO1YJIARdnTNDpTks0glI jNJT8y/AyXtkTt8mJkGTB2XTogACEybpkKHHgtEo8sfvoqFgtD4c1H7SEtE7EhSsMXnu URiVL2HTOeUJ67QykP6wk+16zkoE6yJxEeGYY= 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=punOLD+8HsaTHtF7kvu4oRzCWSlLACsZVbrNn6qfWGo=; b=Lk5rREvBFENzwoYFR5EQSLz+Kc7doF/SWHBqziEwpU6z6qmAIKCZjjadHlhbgdgI20 GKDG5ey5Oy1edJeb79sayspyiZCMWHEBfwvCaIc4QqKml/rkMjn16b19uqiHOVH2oBwC +sCIsZ3OLhL/7nmDS+8aV3o+gn8mMb7Ptq3wt8YOw/xaOWLDeAOWzRc0g+VmG1jwJYiC Dd/WkyjH8Qfb/Hicow4ilpb4ZD6BoPnPOR++gpp8Fi9dTUF8C0CzBQjN5AwTMw4SNubY mmVLI30AVSmnvAGRBeTy+qefmHwSXG4O+9DyxqefP0RkpRx1QTZ9/nMr+3mpFrrFlt58 EPzw== X-Gm-Message-State: AMke39kGn8lgJ3kj6UdQMI5XFxtUd9d+Oz45l3WVA3kecOGPu6/6rZ9JaeZDYBAwaOeXsQZ6 X-Received: by 10.28.11.131 with SMTP id 125mr3203389wml.29.1487952888570; Fri, 24 Feb 2017 08:14:48 -0800 (PST) Received: from lmenx321.st.com. ([80.215.231.24]) by smtp.gmail.com with ESMTPSA id 10sm2871338wmk.26.2017.02.24.08.14.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Feb 2017 08:14:48 -0800 (PST) From: Benjamin Gaignard To: robh+dt@kernel.org, frowand.list@gmail.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, vincent.abriou@st.com, dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/2] drm: sti: make driver use devm_of_platform_populate() Date: Fri, 24 Feb 2017 17:14:34 +0100 Message-Id: <1487952874-23635-3-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1487952874-23635-1-git-send-email-benjamin.gaignard@linaro.org> References: <1487952874-23635-1-git-send-email-benjamin.gaignard@linaro.org> Cc: linaro-kernel@lists.linaro.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" This make sure that of_platform_depopulate() is called if an error occur in probe after populating the date from the device tree. Signed-off-by: Benjamin Gaignard --- version 2: - use simplified devm_of_platform_populate function prototype drivers/gpu/drm/sti/sti_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index ff71e25..b26b1bc 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -438,7 +438,7 @@ static int sti_platform_probe(struct platform_device *pdev) dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); - of_platform_populate(node, NULL, NULL, dev); + devm_of_platform_populate(dev); child_np = of_get_next_available_child(node, NULL); @@ -454,7 +454,6 @@ static int sti_platform_probe(struct platform_device *pdev) static int sti_platform_remove(struct platform_device *pdev) { component_master_del(&pdev->dev, &sti_ops); - of_platform_depopulate(&pdev->dev); return 0; }