From patchwork Mon May 29 15:45:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 100664 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp395067qge; Mon, 29 May 2017 08:46:46 -0700 (PDT) X-Received: by 10.98.12.142 with SMTP id 14mr18257779pfm.66.1496072806440; 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=bLJCy5eWAMmQZmv+tzH79LvGngqD26TMILJn277dvR0oDOvABkGNB9lTwHA4ZS2CZM P3YxDpK5BKbc4pdFeIWj+MaAOZQWDxWRSuJfKxA5Mm58NdCKvVOiN7GumFkWu1KZO4H1 Ry++DXr9cA2Zexqi7i4OL0U3nJrg1wAS8rKfjjUMNMwewkdPYxsWeTM985io7kjb5oEL 7Z4mj7U+2/75Rgv0gsL3p5tLYRPkk+pPVcjB3EPdWN22fKfNIvAm9uS+qMtjh+uAM5zn VwpR1TOtOEmEsx0KseINsagLQ0U2bl95bPhw63O9AATSNEMUL65dxWNcA2XlnGVOc3KR N+YA== 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=LfCxnRYpyIFtj2DIgA6P+Qne5iAcXJr+DQWGUeh3xJw=; b=MTARJkh8RkR6yQYNotI9jyeiO8BdLpYz4e9Vf0tkpXdkHhNceFFbUKUPrQ+kYJ8r+Y 2fCywkLKSmV6OAMiZQFKe/rmTZi4o98k27M1OLDBFOyoH8CHCUkKq2R3c4Q4XcOZzz0/ YsrxCYP8vR3bAENKQZIZliEDe2nLodP1am9uZsSWQBmr2d92LjiS9/OKoHVm5Bqr2qYx pLuRXkwRjEJPaRGHAgN8Sw1DCSnwu3FYGIbSORh0yuzrx5tFoOUQnLtlNb5xng9HAqWr 0mlL8JSMhR71EncXHgKsm63/Kj7ZavKjTNmIzFMpgt5KCCc92LaahU/z8F7BO1GoVOVs ie+g== 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 S1751205AbdE2Pqb (ORCPT + 25 others); Mon, 29 May 2017 11:46:31 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36040 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751163AbdE2Pq3 (ORCPT ); Mon, 29 May 2017 11:46:29 -0400 Received: by mail-wm0-f52.google.com with SMTP id 7so60655842wmo.1 for ; Mon, 29 May 2017 08:46:28 -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=LfCxnRYpyIFtj2DIgA6P+Qne5iAcXJr+DQWGUeh3xJw=; b=EGYkgc5RRo2vQHPEwvK9UhuV/Iue/MhfsahWnMoeHPBxOw1XgwSW75gl7tq3IxBhAA 9zSrK2FBZpw5akaKHwrN50zcyF0f+H6dcSAMv8sM22cGflbXcVOyVR5+CbxOwGDW5Png 12aTS+oNv7XmETSHdjUpCaHlxJ7p4VcMXbhEo= 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=LfCxnRYpyIFtj2DIgA6P+Qne5iAcXJr+DQWGUeh3xJw=; b=B3F6Ym/1BCOMz7r8w+40fb+1vMbUshTiXL3TTSoaGk4LWkUdIAPPwUmWgQ6eFJ6Kgf Zod2a3F0TsFdcNnbcytYl84vjyXPEgMbJA49d1Nj/OMNBvJy1Qyn/3vbepV7lE9qFbKI WhEopHEg8RoIXcP4b+WWbqunVNt74LDFVDm2/PGMdBqmUb5+iT5OCcPJnKhlxhTsW5RY vQeCl17BRqfxqlN9QA3U7qS85OZnjaZ6gLpOl0In0JZPjgLJ6lWyZlIL8Ctmdxku+Dh5 t++pNjhIDp1Fa4cPoIn71VCkjGj7vfUIOH6hIF9ldS+NFPu6BusNbpp5HAbBVigGILfP pkmA== X-Gm-Message-State: AODbwcDVcfOq90G+zTn06wteJIl10tbTr5Nom9CtS363Hn/bvK9xV9Au STvD4P6D93HtH2nM X-Received: by 10.223.170.142 with SMTP id h14mr10425866wrc.140.1496072787586; Mon, 29 May 2017 08:46:27 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 May 2017 08:46:27 -0700 (PDT) From: Benjamin Gaignard Cc: Benjamin Gaignard , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Alexandre Torgue , Fabrice Gasnier , linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/15] iio: dac: stm32: use devm_of_platform_populate() Date: Mon, 29 May 2017 17:45:50 +0200 Message-Id: <1496072763-31209-3-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() instead of of_platform_populate and of_platform_depopulate to simplify driver code Signed-off-by: Benjamin Gaignard CC: Jonathan Cameron CC: Hartmut Knaack CC: Lars-Peter Clausen CC: Alexandre Torgue CC: Fabrice Gasnier CC: linux-iio@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org CC: linux-kernel@vger.kernel.org --- drivers/iio/dac/stm32-dac-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/iio/dac/stm32-dac-core.c b/drivers/iio/dac/stm32-dac-core.c index 75e4878..9c42537 100644 --- a/drivers/iio/dac/stm32-dac-core.c +++ b/drivers/iio/dac/stm32-dac-core.c @@ -130,7 +130,7 @@ static int stm32_dac_probe(struct platform_device *pdev) platform_set_drvdata(pdev, &priv->common); - ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, dev); + ret = devm_of_platform_populate(&pdev->dev); if (ret < 0) { dev_err(dev, "failed to populate DT children\n"); goto err_pclk; @@ -151,7 +151,6 @@ static int stm32_dac_remove(struct platform_device *pdev) struct stm32_dac_common *common = platform_get_drvdata(pdev); struct stm32_dac_priv *priv = to_stm32_dac_priv(common); - of_platform_depopulate(&pdev->dev); clk_disable_unprepare(priv->pclk); regulator_disable(priv->vref);