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: 100677 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp396021qge; Mon, 29 May 2017 08:49:38 -0700 (PDT) X-Received: by 10.84.198.36 with SMTP id o33mr78030054pld.145.1496072978682; Mon, 29 May 2017 08:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496072978; cv=none; d=google.com; s=arc-20160816; b=A1/WeZCm/djPtTQm3SEmegRQ54QT7YtPVLHEEEFtwcX2ijFds9sKR29o3y/ETJBHIu FUAdrFxD64FD9sGellBP041mvFYFC/l7HbDtA11SGkN4lytTHhvamz9C1x6oGzBiNIGw fjPqZunr/e+EN6BUYyLVjhbsO6D0Raq0QEdDWfWY8BSswyDhDqLKuAi/n062ZgsI3Pgu 8EBHy+e8FbjFSRFumh+CfHQY723bP+7AJvD5tiUh0mDV2xalWj/99BVIcI0QcKwPcj6w /jaeCj1PJCidz1s5e7b6EOaeItTef/TBd4Nk/H0LZeemIEEcb/UGFRYeSSuDsfQZjF31 7zKw== 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=g4PWDjjctS8Uz1yoNsOy1bNV3TnUZ0UJSyPTTRyJ4q8=; b=ibvj49VSVWWaCZLTMS+AJK82CF/39EI6ugjhkt9oj//P7wjKpJ4JMFvKrANNerVYXq dY4/+INLr4cv/p2wu3pm0VnXiY6vJ/ZA4q2CwkvNXUHWyHfMwCXHdVY7J1Enywuv0Yy7 MFWC1lazbnGsmlJ++r0Tf5KCuh9QicEGaFCYKlHI0GOQgmJYOgjBdcdJZvd6aR2vaO1K 2y6ibcY4nBGWGnxYxNUqrqKZvgsSZujw5y6jlXUXB23mVP7qFlHgs//lyitQnL7gIoq3 zvC6wvhMBACMAVxE7XRO1wnw2wRbj5Sn40EIADryCO5dfQlLKGYZbvNVj61vHGcwvsU/ 2MTQ== 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 10si10396197pga.419.2017.05.29.08.49.38; Mon, 29 May 2017 08:49:38 -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 S1751428AbdE2Ptg (ORCPT + 25 others); Mon, 29 May 2017 11:49:36 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:38200 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074AbdE2Pq1 (ORCPT ); Mon, 29 May 2017 11:46:27 -0400 Received: by mail-wm0-f53.google.com with SMTP id e127so65976897wmg.1 for ; Mon, 29 May 2017 08:46:26 -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=pqsZUPaQEKqe92eB/XzGtIag9Hjp8rNNGcZ4SlQNe/T8T7OWy6E7ecxT0vH3caVRNi cssE/EQGORgGVFCo4pDD1Et1W0AGrQj70lNm5UzW1cJ44bMYRHdYA2ZrkWrjtOeNlsdt /jURvvfCQaErYkru9+XmaKSHmcFnYZCfPqhRlvV+AirTzSJsWm4Aq7sxHZw7KIJh4Im9 uDualMXKW41NiLKIW2+piwOLP/xZr4rvdOb/jHCLeXYOzNj8p0cZwH+D+swWro0Y6v9D pibTUOBCn8arJLXYYjPdH4zkKvIziSgaALSfjtk4Piwc5X1fcyToX2Hx3gWgnIOLd2cH PoTQ== X-Gm-Message-State: AODbwcBzlMEq2w1bHuScQtHDblz8fO3FeE0FFM+iH4C+GC4NzBujvcxS FQqIh3Ya1p2X/J9N 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 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 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> 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/adc/stm32-adc-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 1.9.1 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);