From patchwork Mon May 29 15:46:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9753423 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 E318C6038E for ; Mon, 29 May 2017 15:48:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D568F237A5 for ; Mon, 29 May 2017 15:48:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9A5D27FB6; Mon, 29 May 2017 15:48:34 +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 6FDE7237A5 for ; Mon, 29 May 2017 15:48:33 +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=pzaKD67+F0MLCKOwXDkK4UtcBrX3Z2eHyyspHKuk4VU=; b=bbTNzi7+d9QmXVsn3P5nZ+buT1 EXXzbVSO/jmZ4R9iCulUpp0oGHCEFeDM/vDT1ctWcXczLfIJKCxvoOnXWt+xBXxnuwbctw9oKnYMk 4EfEVf1kMnoLFueFMJo4SRcTJUVIFBTJs+eJWdR/xlKD2UZsdgmIQGwFhiUtem3qohnOVsGe0ODTX vzAnIducsC5WKUBM66Bg1b+UI34WpQXi4EBzvdSsb9yG8GyE9BQyeIywN93Jfhyp1DQsRLTIKYUuS DuK7iS4NgAqre/afPuADxkH/CBoiM/DPccH+UQdIffEDoBtjRL2bmjfoy+DQ5bGk8JzRUDeKgf59h iJjiF4zQ==; 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 1dFMuG-0001M2-HW; Mon, 29 May 2017 15:48:32 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dFMsr-0008VA-HG for linux-arm-kernel@lists.infradead.org; Mon, 29 May 2017 15:47:07 +0000 Received: by mail-wm0-x232.google.com with SMTP id 7so60663847wmo.1 for ; Mon, 29 May 2017 08:46:45 -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=Oe71OZ/fwGF7WxwsSHjCUWY8lrszx0uJdhcBhtrdjHg=; b=irqndlKGW0hhdoTXyJkBcrwzXJyG1oADSqydjyCdy5PT3jHVj782B44Uq+LAb4cVPz ycMqLNmWeZ9EylENAnwnUBNTDXBFGEfRB/JGebJTlHqvIj5qw1FyoC05YqdmIEeRVP3/ Nnq4IveFpT7CS/MQuPjyBSJQC+k4iuZZn7FBc= 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=Oe71OZ/fwGF7WxwsSHjCUWY8lrszx0uJdhcBhtrdjHg=; b=PodFpaPZsg9QzDJdEmjz+guau/Ahwj+TYLu62GKK3kNGJ8CkIpDwEhMLv1DRwbY2R1 Wiqll18wIuMUdgZM0Z30h8cAvbzVM+Ljw0FaIyIfzby1n8isrStWZKQ90W0iKpDolV5g xufL742npvXzaUpslbniV+LQZjySDsnQFjc+bsSxPicEzuXyd1MuxoQohKYeenNeU9bu ttBkVP/hajnEoYBknDPJ+W+/FqkdrC7AZ78t6m6KxWfdp7D+jwkqPH6zcEArrFzNwemF cUX/1oyEj+W7qV42hTeY1yjmPuAxfzXxAWl30LDQdzNEJlmPIzIs8UJCig1J6SOmxfxf aGqA== X-Gm-Message-State: AODbwcDKt5h0LFI97M28C99V4TmRirqS+MDs/RoDEjolf+sSfhbyn+HY BoYr9UC6x0Z7Gsss X-Received: by 10.28.49.198 with SMTP id x189mr23711428wmx.93.1496072803868; Mon, 29 May 2017 08:46:43 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 May 2017 08:46:43 -0700 (PDT) From: Benjamin Gaignard To: Subject: [PATCH 14/15] sound: stm32: use devm_of_platform_populate() Date: Mon, 29 May 2017 17:46:02 +0200 Message-Id: <1496072763-31209-15-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_084705_720316_8B2A1D69 X-CRM114-Status: GOOD ( 11.13 ) 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: alsa-devel@alsa-project.org, Olivier Moysan , Alexandre Torgue , linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Mark Brown , Benjamin Gaignard , Jaroslav Kysela , linux-arm-kernel@lists.infradead.org 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 Usage of devm_of_platform_populate() simplify driver code by allowing to delete stm32_sai_remove(). Signed-off-by: Benjamin Gaignard CC: Liam Girdwood CC: Mark Brown CC: Jaroslav Kysela CC: Takashi Iwai CC: Alexandre Torgue CC: Olivier Moysan CC: alsa-devel@alsa-project.org CC: linux-arm-kernel@lists.infradead.org CC: linux-kernel@vger.kernel.org Acked-by: Olivier Moysan --- sound/soc/stm/stm32_sai.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c index 2a27a26..25304f8 100644 --- a/sound/soc/stm/stm32_sai.c +++ b/sound/soc/stm/stm32_sai.c @@ -34,7 +34,6 @@ static int stm32_sai_probe(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node; struct stm32_sai_data *sai; struct reset_control *rst; struct resource *res; @@ -86,14 +85,7 @@ static int stm32_sai_probe(struct platform_device *pdev) sai->pdev = pdev; platform_set_drvdata(pdev, sai); - return of_platform_populate(np, NULL, NULL, &pdev->dev); -} - -static int stm32_sai_remove(struct platform_device *pdev) -{ - of_platform_depopulate(&pdev->dev); - - return 0; + return devm_of_platform_populate(&pdev->dev); } MODULE_DEVICE_TABLE(of, stm32_sai_ids); @@ -104,7 +96,6 @@ static int stm32_sai_remove(struct platform_device *pdev) .of_match_table = stm32_sai_ids, }, .probe = stm32_sai_probe, - .remove = stm32_sai_remove, }; module_platform_driver(stm32_sai_driver);