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: 100668 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp395170qge; Mon, 29 May 2017 08:47:01 -0700 (PDT) X-Received: by 10.99.109.141 with SMTP id i135mr19894828pgc.33.1496072821783; Mon, 29 May 2017 08:47:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496072821; cv=none; d=google.com; s=arc-20160816; b=mwOmJVGDfrpDsMSaxZ3a1G5wLgnHXCMbjAWYlR8HzsQ5zNFgFaVAZ4YvRcwRPH1rVX sLmwMVysmqBFAu6eBO1svWYIc88kC6qdzeQ0ezr2kkUiZfTJAm3mC9WxD3XIx9WoqlP6 FHt+E440CpwvANkJOos7StTEmD8RgPizCd7NmI/sYURPilXVgh0jrg/tF2nwKNAs6IxS zBsgs4fgMUVIg/Onz8x87kGavVikbWtKaAALJL6PD5/6w0lc8e0N559Fw2uX/vxZdepN gb1xFPnKkj45JuWVedeXWx1PLfiSxV7SdrtwkI6WPp0JlnryHJE9Nkuc1GDyGWTstl7O 76SQ== 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=Oe71OZ/fwGF7WxwsSHjCUWY8lrszx0uJdhcBhtrdjHg=; b=Nzgqf66D9hR78IjY2WYBvwb+07aBPDgjNYLaOMB3CXOYaGpAWLUZLMc+72+2jiKY5C /ix738nfwK4vu+OYBp3t0Nt53PCFSwJzooXK0lZpN9OAqbKC4uRa0e3poXEwWzsFZBfj 3xvlC1CwZG2vW0vi9Ra9RefPfie7KrCa/Tz15bfAElA4sazfzTQc6nndN3mAY5fS2hXO Y8Stuzue6DiO/M2uhkhRe1muKl+UzLKsqLO5KTtCyZBk1F0LBfNvqCK4l6FX/roO/u+4 LOdnUPe7ayUBtYexhkz55ayUMP5D00xv2bEB7iuP3JtmknGR86ygSX//yW1wmOJMw0sR ojhQ== 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 190si9455906pgi.411.2017.05.29.08.47.01; Mon, 29 May 2017 08:47:01 -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 S1751381AbdE2Pqs (ORCPT + 25 others); Mon, 29 May 2017 11:46:48 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37331 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbdE2Pqp (ORCPT ); Mon, 29 May 2017 11:46:45 -0400 Received: by mail-wm0-f43.google.com with SMTP id d127so64535788wmf.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=QyigNGdB0HXnEde5EApMKOl12XoWFLuBXx0IrkUJzZo2Fy1UdVDiPo5eZEBdGElmD8 bR/tcif16GMFOyTq+lRXbVzyoGWPtCmHxR9xFz/mrEB/1XLNCIpfqzHVa1PvYNPf/hEX pouw4Ey/UVMq8zNjvucH+vIFEryvhBKzfVOJA1goctHkNGutsqXACbSORpxdIglDs7FO x6U6qMXEcG/w2i97JdsX/FHACIFfeQX4iTHzOzNz0P3Pf505uJVBG/tE+BWhcF/uKWHR eYdtXMFIC7i2ACqzDUJjDx4MJmfkxB4ILomvf8v65RESCQZr85F7xibKP3X0DqD0POcN XVog== X-Gm-Message-State: AODbwcAmjDlMOAtewpM49nJ2TdOLCRBwkTJZBHPygBRIXTTEITPxDPoC uVrcduLL75uOiqE1 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 Cc: Benjamin Gaignard , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Alexandre Torgue , Olivier Moysan , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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> 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 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 --- sound/soc/stm/stm32_sai.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) -- 1.9.1 Acked-by: Olivier Moysan 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);