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: 9590663 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 285F4604A2 for ; Fri, 24 Feb 2017 16:14:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A079286E0 for ; Fri, 24 Feb 2017 16:14:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EC78286FD; Fri, 24 Feb 2017 16:14:56 +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 F3681286E0 for ; Fri, 24 Feb 2017 16:14:55 +0000 (UTC) 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" X-Virus-Scanned: ClamAV using ClamSMTP 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; }