From patchwork Thu Aug 4 13:38:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 9263669 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 9D7C06048F for ; Thu, 4 Aug 2016 13:40:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F3DB28406 for ; Thu, 4 Aug 2016 13:40:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83D0A28409; Thu, 4 Aug 2016 13:40:31 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2247D28407 for ; Thu, 4 Aug 2016 13:40:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933738AbcHDNk1 (ORCPT ); Thu, 4 Aug 2016 09:40:27 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:43534 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933733AbcHDNkZ (ORCPT ); Thu, 4 Aug 2016 09:40:25 -0400 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OBE013KD0GKDQE0@mailout3.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 04 Aug 2016 22:39:35 +0900 (KST) X-AuditID: cbfee61a-f78ff6d000001462-8a-57a34596d86e Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 28.E8.05218.69543A75; Thu, 4 Aug 2016 22:39:35 +0900 (KST) Received: from AMDC1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OBE000Y20L4R530@mmp1.samsung.com>; Thu, 04 Aug 2016 22:39:34 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Cc: krzk@kernel.org, alsa-devel@alsa-project.org, b.zolnierkie@samsung.com, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sylwester Nawrocki Subject: [PATCH 6/8] ASoC: samsung: Convert s3c24xx_uda134x to use devm_snd_soc_register_card() Date: Thu, 04 Aug 2016 15:38:46 +0200 Message-id: <1470317928-25365-7-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1470317928-25365-1-git-send-email-s.nawrocki@samsung.com> References: <1470317928-25365-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMLMWRmVeSWpSXmKPExsVy+t9jAd3provDDa61slpcuXiIyWLjjPWs FlMfPmGzOH9+A7vFpsfXWC1mnN/HZHH4TTurA7vHhs9NbB6bVnWyeWxeUu/Rt2UVo8fnTXIB rFFcNimpOZllqUX6dglcGXt3hRSsFa14/XYHYwNjk1AXIyeHhICJxM7mzWwQtpjEhXvrgWwu DiGBpYwSZ493sUI4vxgljqw7wwJSxSZgKNF7tI8RxBYB6rg9p5MZxGYWOMIosXctO4gtLJAo cXnjZSYQm0VAVeJw4yugQRwcvAJuEmt+uEMsk5M4eWwyWJhTwF3ixRYPkLAQUMXXV8dYJzDy LmBkWMUokVqQXFCclJ5rmJdarlecmFtcmpeul5yfu4kRHFTPpHYwHtzlfohRgINRiYf3gumi cCHWxLLiytxDjBIczEoivL+dFocL8aYkVlalFuXHF5XmpBYfYpTmYFES5338f12YkEB6Yklq dmpqQWoRTJaJg1OqgVHN+pqcutWqt4yxzo2KLNVfZr+ZHMF+LoCF0a7vRaffO+6+qVHHztUm Bh6oEP9d+tCfy6vr2SJPI/tpn4PkcjWm72j+zKWctu3689lLPmv+33a/2uvwuyC2gCsux03Y UxLaNc39PzuFdlifuSvEq3r5zKW5U4xrNupOPCJe6u4TeX//s+1XdyuxFGckGmoxFxUnAgD2 2pmIJgIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Suppreses a following kernel warning: "soc-audio soc-audio: ASoC: machine S3C24XX_UDA134X should use snd_soc_register_card()". Signed-off-by: Sylwester Nawrocki --- sound/soc/samsung/s3c24xx_uda134x.c | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c index 794e30d..a8102a7 100644 --- a/sound/soc/samsung/s3c24xx_uda134x.c +++ b/sound/soc/samsung/s3c24xx_uda134x.c @@ -54,8 +54,6 @@ static struct snd_pcm_hw_constraint_list hw_constraints_rates = { }; #endif -static struct platform_device *s3c24xx_uda134x_snd_device; - static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -68,7 +66,7 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream) mutex_lock(&clk_lock); pr_debug("%s %d\n", __func__, clk_users); if (clk_users == 0) { - xtal = clk_get(&s3c24xx_uda134x_snd_device->dev, "xtal"); + xtal = clk_get(rtd->dev, "xtal"); if (IS_ERR(xtal)) { printk(KERN_ERR "%s cannot get xtal\n", __func__); ret = PTR_ERR(xtal); @@ -229,43 +227,25 @@ static struct snd_soc_card snd_soc_s3c24xx_uda134x = { static int s3c24xx_uda134x_probe(struct platform_device *pdev) { + struct snd_soc_card *card = &snd_soc_s3c24xx_uda134x; int ret; - printk(KERN_INFO "S3C24XX_UDA134X SoC Audio driver\n"); - - s3c24xx_uda134x_snd_device = platform_device_alloc("soc-audio", -1); - if (!s3c24xx_uda134x_snd_device) { - printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: " - "Unable to register\n"); - return -ENOMEM; - } + platform_set_drvdata(pdev, card); + card->dev = &pdev->dev; - platform_set_drvdata(s3c24xx_uda134x_snd_device, - &snd_soc_s3c24xx_uda134x); - - ret = platform_device_add(s3c24xx_uda134x_snd_device); - if (ret) { - printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: Unable to add\n"); - platform_device_put(s3c24xx_uda134x_snd_device); - } + ret = devm_snd_soc_register_card(&pdev->dev, card); + if (ret) + dev_err(&pdev->dev, "failed to register card: %d\n", ret); return ret; } -static int s3c24xx_uda134x_remove(struct platform_device *pdev) -{ - platform_device_unregister(s3c24xx_uda134x_snd_device); - return 0; -} - static struct platform_driver s3c24xx_uda134x_driver = { .probe = s3c24xx_uda134x_probe, - .remove = s3c24xx_uda134x_remove, .driver = { .name = "s3c24xx_uda134x", }, }; - module_platform_driver(s3c24xx_uda134x_driver); MODULE_AUTHOR("Zoltan Devai, Christian Pellegrin ");