From patchwork Mon May 29 15:45:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9753437 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 3594F6038E for ; Mon, 29 May 2017 15:50:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2813823B24 for ; Mon, 29 May 2017 15:50:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CC8427E71; Mon, 29 May 2017 15:50:41 +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 C52E723B24 for ; Mon, 29 May 2017 15:50:40 +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=o8aidHmwHH/y8m83AFKZ6fEtA5zSBPi1CvmAn3lJluU=; b=CyfGlEPaTL8hCjHFhYV8eP37Tl +gmKiDPeuo0nI/A1GNXkCCaqoCry5KAawFx5k329MFPdADEoD5+nflkqk4oaLm1O9rVesugwhseMH mFkc9o3omZ0fyOxKVkSwe3tx7yd79OD7pY0BRhFVTZiSZ6XevBROa1SzGBhyTNClvttga5/Cu2WGj FV1VaRnsK2gLcvTf55JtN3l/6ljpKDyR/cakjG/uLBmJQPV6tab3p+syqN09qEvPRj0tEe07El51M IZcNdtaqFZBXxFWEDoUq86PnpU2NR/Eh3BUELb4IosipUH74/Tfrs1ciGXW8Wywv7tGwyZO3498zT 5U1SnQaw==; 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 1dFMwG-0002z7-Hz; Mon, 29 May 2017 15:50:36 +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-0008To-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 b84so60804464wmh.0 for ; Mon, 29 May 2017 08:46:27 -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=g4PWDjjctS8Uz1yoNsOy1bNV3TnUZ0UJSyPTTRyJ4q8=; b=AQrLZJ/q4FJfRGNJvOZ5JR6+M8F/234fq6dacw4qes+KNHXzCkEHEo96ZTSQ0uLl6R A/eCJ6d82u3QPqmDezBNZT1bltwQkiE5RXEpIge++UsqMJB25ZmHof/YssFhbauMAcUn i65ZegC+Ip3dtWaoMnC5nGMYVnW1m79QJ/dzg= 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=g4PWDjjctS8Uz1yoNsOy1bNV3TnUZ0UJSyPTTRyJ4q8=; b=rkItUqWdihtAfzIQgnohwCoiDTpTxYiSoxUghxdnVnx3CETeC6eF1TA+Kt0Vw7j96Y ApQ8xx/z1s9VeuaI3gwahVjXG3yi2w1E+FhJZVpRIbkFjR4kkx2Q1yml7bDyZhGrMFAF xSe53Ed+bBUy2VrVZogyQHwRiyznTz+LXyptVXwvafLR6cGHpFVS0GFl1DKmkk2K/l9M LunYWvQgm7agb/cH5lsrcvEkgpZtuTA07NhsK+QJJTt3WOzAsdeXnq68lHILLPyjLewT iwvhIRO7fEZL6b4QOoRQaqiFeKXpn28k3Mvq9r0dqThMA4e/H8lKtyGjWacLzlf2yyAB 5Ehg== X-Gm-Message-State: AODbwcAydGv4TdaGN4eS2L5tNKOCdz8tySeeWp4427tVlxRYfVf5QSyp BAP9WVwJW0poDbLC X-Received: by 10.223.155.144 with SMTP id d16mr10615857wrc.202.1496072785753; Mon, 29 May 2017 08:46:25 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 May 2017 08:46:24 -0700 (PDT) From: Benjamin Gaignard To: Subject: [PATCH 01/15] iio: adc: stm32: use devm_of_platform_populate() Date: Mon, 29 May 2017 17:45:49 +0200 Message-Id: <1496072763-31209-2-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_807594_A6E8F597 X-CRM114-Status: GOOD ( 10.86 ) 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/adc/stm32-adc-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c index 22b7c93..46e41dc5 100644 --- a/drivers/iio/adc/stm32-adc-core.c +++ b/drivers/iio/adc/stm32-adc-core.c @@ -186,7 +186,6 @@ static void stm32_adc_irq_remove(struct platform_device *pdev, static int stm32_adc_probe(struct platform_device *pdev) { struct stm32_adc_priv *priv; - struct device_node *np = pdev->dev.of_node; struct resource *res; int ret; @@ -249,7 +248,7 @@ static int stm32_adc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, &priv->common); - ret = of_platform_populate(np, NULL, NULL, &pdev->dev); + ret = devm_of_platform_populate(&pdev->dev); if (ret < 0) { dev_err(&pdev->dev, "failed to populate DT children\n"); goto err_irq_remove; @@ -274,7 +273,6 @@ static int stm32_adc_remove(struct platform_device *pdev) struct stm32_adc_common *common = platform_get_drvdata(pdev); struct stm32_adc_priv *priv = to_stm32_adc_priv(common); - of_platform_depopulate(&pdev->dev); stm32_adc_irq_remove(pdev, priv); clk_disable_unprepare(priv->aclk); regulator_disable(priv->vref);