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: 9753399 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 96C766038E for ; Mon, 29 May 2017 15:46:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A420237A5 for ; Mon, 29 May 2017 15:46:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F26727F86; Mon, 29 May 2017 15:46:57 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0A76237A5 for ; Mon, 29 May 2017 15:46:56 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 487FA2668F0; Mon, 29 May 2017 17:46:52 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D275E26690B; Mon, 29 May 2017 17:46:50 +0200 (CEST) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by alsa0.perex.cz (Postfix) with ESMTP id 66F3C26683B for ; Mon, 29 May 2017 17:46:44 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id b84so60813409wmh.0 for ; Mon, 29 May 2017 08:46:44 -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=dLZ/Wfouv8ZTQtksKhRXzLrC1BI5WutNmdO7uKfiaspBGxpaJqZNZ3jdKyWY8R5Qzr 0fanLkc9xKRo392bt5KMuqqqRGArTj//mPj+6LcH90CypGhtnPFNF8Xemsz35cNtGML9 pD5PqmaQTIjq2v5i/RYXymcXZ5m9IZorWdewHFHjpuOtliAGt8CppBK3U3kPbHqW1DD0 SfuSSGdvKf0S2V9VkREnkWwZooOduKtGZdrFDXR/26dY3H+Uo6Dp+Cmy/zENaNAk/Syi L70iEdf0gA6kys1haIEigdVcTV0UpX+FUly+5k+atJImA1xdUmDfQ1tiDYQvmMF8Toqh 4l3Q== X-Gm-Message-State: AODbwcDGMdHjmCWj6Qv3TFuULRYzHRTwfGlYbYgzwsWorlPu0SVAKYPf FmO7xdrCNKRv5j/d 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: 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> Cc: alsa-devel@alsa-project.org, Olivier Moysan , Alexandre Torgue , linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Mark Brown , Benjamin Gaignard , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH 14/15] sound: stm32: use devm_of_platform_populate() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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);