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: 9753435 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 E81E56038E for ; Mon, 29 May 2017 15:50:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB46A23B24 for ; Mon, 29 May 2017 15:50:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF5E727E71; Mon, 29 May 2017 15:50:33 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8FF1023B24 for ; Mon, 29 May 2017 15:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=aJ8eS9jn4Mx5TnH5p+YXBkbunU0+HoYMpZpyqjcQWeM=; b=qD1KYyvdftrrqYZuEReYD5LEYX VhHGzo1JqpcM6JXUUQC7Dv5BBarhWwSRHYHeyBM6v9RN0UlJ9ETnLsxbv3lhHBATDQ4UwVZM+QklO G/889ydS38EL2EOuOruqLa4JJuhrHlxWKfRqnSeeaTr6d8THAvnWcBWf3Nkc1OdqU6nZg2MSRAE2N LICi+IAFkkWrOr8OdJ2EytyGC71bHgSMo9kvsNaGNZTmUGvcBTchFNMEFzYhE552Y0LrmNeiXqdG4 YeojHpZLNO2ebe73RXcM1yGRTxoPVjASm0EVWd694EFN8K+DNn+n3NNe6zS+OrYyyunVElJIPTzsw h4UmYWDQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dFMwC-0002uC-3p; Mon, 29 May 2017 15:50:32 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dFMsZ-0008Tq-K2 for linux-arm-kernel@lists.infradead.org; Mon, 29 May 2017 15:46:49 +0000 Received: by mail-wm0-x233.google.com with SMTP id e127so65977831wmg.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=FemrEGFsgqAgYUp35vm+RMV5eTqBgREn2H6O0W08ricU71vmVftM3tDpXUHKn2YVpr /BH4vIrll0cJuSJLlOQsSyse+3jeDhALbtlwFHxbT0566tgsot/tcNCVYIYmwq7IpE// pqI6qMabNmyC2NvFfhxpJkbhBxQxBg/BL+ur5VoGmKbdcQhXOuUh2hyyi86Oit4JS9Fx +kCadrXeSHvgyeNahcE4doAvv9amykrXf8RFCJ2b7d2ITuGyux2z0CDRwHY4v4BdbH0k BQu6ksfdpgxjOjA0/XlVN2/E8J+VxIbEmwMJzLfan/+iRN/w5kc4QoI8aC/G5nkzJsYR W5yg== X-Gm-Message-State: AODbwcAvllC5Y1vhhgwbMrfe9Ts7qkKg28CMKk5FfwXE5TbtDyNtJc3+ TbZrI3yk1bJJ7tiM 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 To: 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170529_084647_807607_EE7BFE9E X-CRM114-Status: GOOD ( 10.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lars-Peter Clausen , Alexandre Torgue , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Benjamin Gaignard , Hartmut Knaack , Fabrice Gasnier , Jonathan Cameron MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);