From patchwork Tue Jul 3 08:34:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 9780 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 16AC723E56 for ; Tue, 3 Jul 2012 08:46:25 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id D4CD2A18382 for ; Tue, 3 Jul 2012 08:46:24 +0000 (UTC) Received: by ghbz12 with SMTP id z12so5448350ghb.11 for ; Tue, 03 Jul 2012 01:46:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=SlKXSwyML1nL5kXUveVMMBZH2oVohGR+jDXzaQkpIcA=; b=OUGko/b0OSW+bW//N8lF8G5x734Z2HLjCR9/dx/Ul1JYAU8oqJO0cSHx53eKg9WiD4 j4wrWgYDeKmiltHTHQqsv2ZR7vjDpVnfnLRRYz1HfBVh370gIEj5eQMZLUX5iJ1F/W+o +OTYMOyCGk50vwcBnR3gnhGTiJSzXp4iBczGPUwwSqrmAeFyTWrWDZK87EZLf91xbxeb hP8cijRSyzqyqbnDi76RHg7MFb1tSKiZ4jwbr7iJrxd2D9/MrnjK3nwT0kk2bOTcvOz6 SmzpPX8mKyhxRS8vosEjXmOTweEJ91eVy8W/3+K2OLsJMefeV/n6KZtbwY99VfSRNpVV mFqA== Received: by 10.50.163.99 with SMTP id yh3mr7478874igb.53.1341305184049; Tue, 03 Jul 2012 01:46:24 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp36850ibb; Tue, 3 Jul 2012 01:46:23 -0700 (PDT) Received: by 10.236.76.165 with SMTP id b25mr19423835yhe.0.1341305182762; Tue, 03 Jul 2012 01:46:22 -0700 (PDT) Received: from mail-yx0-f178.google.com (mail-yx0-f178.google.com [209.85.213.178]) by mx.google.com with ESMTPS id g9si5267685ani.123.2012.07.03.01.46.22 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 01:46:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.213.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by yenl6 with SMTP id l6so5922039yen.37 for ; Tue, 03 Jul 2012 01:46:22 -0700 (PDT) Received: by 10.66.86.165 with SMTP id q5mr27547558paz.72.1341305181885; Tue, 03 Jul 2012 01:46:21 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id tq4sm15125516pbc.11.2012.07.03.01.46.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 01:46:21 -0700 (PDT) From: Sachin Kamat To: alsa-devel@alsa-project.org Cc: linux-samsung-soc@vger.kernel.org, broonie@opensource.wolfsonmicro.com, sbkim73@samsung.com, kgene.kim@samsung.com, tiwai@suse.de, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] ASoC: Samsung: Convert to use snd_soc_register_card() Date: Tue, 3 Jul 2012 14:04:04 +0530 Message-Id: <1341304444-11188-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQlZL0wpmV+8c7fKwfePUY7lkcsNeA7lBomqUy+AcAne0dLPDdD3y4ep87owsxhY1Nck7tgK Current method for machine driver to register with the ASoC core is to use snd_soc_register_card() instead of creating a "soc-audio" platform device. Signed-off-by: Sachin Kamat Acked-by: Sangbeom Kim Acked-by: Sangbeom Kim Acked-by: Sangbeom Kim Acked-by: Sangbeom Kim --- sound/soc/samsung/smdk_wm8994.c | 36 +++++++++++++++++++++++------------- 1 files changed, 23 insertions(+), 13 deletions(-) diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index 8eb309f..3ea3098 100644 --- a/sound/soc/samsung/smdk_wm8994.c +++ b/sound/soc/samsung/smdk_wm8994.c @@ -149,31 +149,41 @@ static struct snd_soc_card smdk = { .num_links = ARRAY_SIZE(smdk_dai), }; -static struct platform_device *smdk_snd_device; -static int __init smdk_audio_init(void) +static int __devinit smdk_audio_probe(struct platform_device *pdev) { int ret; + struct snd_soc_card *card = &smdk; - smdk_snd_device = platform_device_alloc("soc-audio", -1); - if (!smdk_snd_device) - return -ENOMEM; + card->dev = &pdev->dev; + ret = snd_soc_register_card(card); - platform_set_drvdata(smdk_snd_device, &smdk); - - ret = platform_device_add(smdk_snd_device); if (ret) - platform_device_put(smdk_snd_device); + dev_err(&pdev->dev, "snd_soc_register_card() failed:%d\n", ret); return ret; } -module_init(smdk_audio_init); -static void __exit smdk_audio_exit(void) +static int __devexit smdk_audio_remove(struct platform_device *pdev) { - platform_device_unregister(smdk_snd_device); + struct snd_soc_card *card = platform_get_drvdata(pdev); + + snd_soc_unregister_card(card); + + return 0; } -module_exit(smdk_audio_exit); + +static struct platform_driver smdk_audio_driver = { + .driver = { + .name = "smdk-audio", + .owner = THIS_MODULE, + }, + .probe = smdk_audio_probe, + .remove = __devexit_p(smdk_audio_remove), +}; + +module_platform_driver(smdk_audio_driver); MODULE_DESCRIPTION("ALSA SoC SMDK WM8994"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:smdk-audio");