From patchwork Fri Feb 24 16:14:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 94489 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp758382qgi; Fri, 24 Feb 2017 08:14:48 -0800 (PST) X-Received: by 10.99.8.4 with SMTP id 4mr4383109pgi.204.1487952888467; Fri, 24 Feb 2017 08:14:48 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id t22si7754163plj.98.2017.02.24.08.14.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2017 08:14:48 -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 598876E17A; Fri, 24 Feb 2017 16:14:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) by gabe.freedesktop.org (Postfix) with ESMTPS id 241326E17A for ; Fri, 24 Feb 2017 16:14:46 +0000 (UTC) Received: by mail-wm0-x230.google.com with SMTP id v77so18133330wmv.1 for ; Fri, 24 Feb 2017 08:14:46 -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; bh=F3vehlE30zC5k2hcYlblLtNLhLI6ZDGCVOnJZZBP+Uk=; b=CXZaAxfcUtXtwKyzbTkxIEmumdBO+8NJwLxqW+8UNLxzYhszBAZPfmzXR554dn78za k2c1WnG1xAFLodLSgtJ+ODSuVIYjkxT70fqx0EYjmuekVgUz1RWzNBLmFKU2WxRhKHcP f7mZFKYZMWWjxfYdn6z3jVhea/DhOswpgQbyA= 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; bh=F3vehlE30zC5k2hcYlblLtNLhLI6ZDGCVOnJZZBP+Uk=; b=YU8OxiAV4aUtyCgi9OiOu7N+1edMOpCqaGQqRIMKh5OEljm+yFfKrOdAU8AeKHow6B CV68wcCV4R3mgoD3qMFKJWqxPe3VkHbH418/Gduo39Z+2TaLsKBDPp/1qifRRpgEGQWL sh1BsdP8mrBSjV9cRY2AAzXbbCK7JEpv+dhFL8yU09e3Gv6UrGJE92EO443fspW5VG6C C2ULp9KppK0m8uuL69Hy//sMmxFNs9ekuwUPyhet1+pVW9Qlrllm7YpbWsZnP7EL8Otg K0RnmHSsCzryGfCPs0l9rwSmTJ4fCsnrJCAXezuSW8v8yIiAeKWocZ/VuswjI9SqFnT0 kBfQ== X-Gm-Message-State: AMke39mP5aIW4UMB60vuXSlL/DN7+hw4YBnnG/aaXNPM0hLFeshOjHM/lAtR9nbNRifBG6Jy X-Received: by 10.28.175.148 with SMTP id y142mr800994wme.15.1487952884686; Fri, 24 Feb 2017 08:14:44 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Feb 2017 08:14:43 -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 0/2] Introduce devm_of_platform_populate() helper Date: Fri, 24 Feb 2017 17:14:32 +0100 Message-Id: <1487952874-23635-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 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" version 2: - simplify function prototype to only keep device as parameter - rebased on v4.10 Lots of calls to of_platform_populate() are not unbalanced by a call to of_platform_depopulate(). This create issues while drivers are bind/unbind. In way to solve those issues is to add devm_of_platform_populate() which will call of_platform_depopulate() when the device is unbound from the bus. This also could make drivers more robust in case that probe failed after calling of_platform_populate(). Benjamin Gaignard (2): of: add devm_ functions for populate and depopulate drm: sti: make driver use devm_of_platform_populate() drivers/gpu/drm/sti/sti_drv.c | 3 +- drivers/of/platform.c | 71 +++++++++++++++++++++++++++++++++++++++++++ include/linux/of_platform.h | 11 +++++++ 3 files changed, 83 insertions(+), 2 deletions(-)