From patchwork Fri Jul 13 15:36:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 141910 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp951079ljj; Fri, 13 Jul 2018 08:39:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqmAsdNYt13JGLGhj9C0NENeDhCPPheak+5h6ZGTpuxtrAjYd6TbcDVcMrxmbdClFSG/vG X-Received: by 2002:a65:41c6:: with SMTP id b6-v6mr6496961pgq.174.1531496373603; Fri, 13 Jul 2018 08:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531496373; cv=none; d=google.com; s=arc-20160816; b=zVrex6pulc2qo9+uhQZwe0KzucjgvifGwbWMmMpnVzqaQCiQ6w5On1m6vByWTApfeb qR4zlYwQfdAWvVqINIBNuPTFUGxOfH/UP5StplHKodm07P4DywkcICMy5fLCVsJt0PqE S/xpaP5dUW4McrttpqzSmu/gH/nv3QbDXZBOQVTXKaM8QCnKkPt4XPHtE4lCMaIODXW3 klugf22y7Klnv2ji2odzLEw/yEjfMYHbzV+LTNUf4U2zF2taQ+APdZP9yx3R5PwuStoq KaY4LWi72hJUkeKMBi8PsB5CUVqCThrWUzM940SWUtS330zvJ1U32Kkk8aib0WbaEwZs wq5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=gfafMkLu59T46j/xhUfD5cqyO4e9j7V6stGEV8DhnRc=; b=vPQeAj+SIObRf0j3MD2XkgNz5TYWHkeKc2f6++DfLLJvQ+oAtXS1DazEFN11Y+cThT 1e5xV7h2NueBS+4t3YFP5s4Uoxly4hEzqbDws3WfrQtpXTkpOmOQpnRZmkZhv1trf1D9 T/eezFXcFEDa0sboiTWh652ciYm3t6vfN/mWJhuX2CQ+JsyUsEfTswVmZ2s9O8k0K6BB Tfv2eflxD51Tq9zgcbp0UuMAFGKGclxZhYG5lRkmBgY0TCD25TxaizTTD3A9ybgh4n/r ujp5Sdj608PeTiPTRxmqVNv8emWIkLglRajpADkJN5pq3AoJ8qzZ51qNZ3ctHbZOfVXa WlbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SiO1Emh8; 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=pass (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 v6-v6si24243018ply.300.2018.07.13.08.39.33; Fri, 13 Jul 2018 08:39:33 -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=pass header.i=@linaro.org header.s=google header.b=SiO1Emh8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731957AbeGMPyi (ORCPT + 31 others); Fri, 13 Jul 2018 11:54:38 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34621 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731895AbeGMPyg (ORCPT ); Fri, 13 Jul 2018 11:54:36 -0400 Received: by mail-wm0-f65.google.com with SMTP id s13-v6so4816175wmc.1 for ; Fri, 13 Jul 2018 08:39:26 -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=gfafMkLu59T46j/xhUfD5cqyO4e9j7V6stGEV8DhnRc=; b=SiO1Emh86qjtfSNJR7vucbFQ6L8onXUyDYX/fF/5fLwHHDMXgBTZPTMLvWWPejyFcN Vxdx0yna9wR/XE3oHaCAOZTYwzYrRStplMLXIaDmr3wNA/4SuPTE22K1myLyLI3VCRFA ZShF9nplPT7ITYTLG2A30rgjj2Tvxir2zoMzQ= 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=gfafMkLu59T46j/xhUfD5cqyO4e9j7V6stGEV8DhnRc=; b=RAt6mLI337cgkZfHgCUXPfh+edUkv44xz29POWiDrSejaW/insfB2pvtG8NGgob+EV JeS6L5NYJpzE/sFYs2Nufo6qPlZtk8l+A9PfVuv2Pjm5hZT0Wbpu9cxPlc6VVRlz2Xzs IYUrlE691hpC1LSuMQbD3ipSnVGs14U1v+B35m4OvWiz5yrefGzpWt2Ta+SyENyEG9yG y+VI5M98lT+Se1assV/wG3XWvsR7PdfIjVcEynTVB11JfdxEXPmhf5PgaICzMfNR8mZT fGq2hcbvIxRTE8n+LHFus4ipsacJCu9/vgqb0gfXpf435YXF1/dBi3qqUnNYmnfY1wC0 webA== X-Gm-Message-State: AOUpUlFw3PBMwJMW8RRCAWXD16VxfC2OF/K0Fz2yqBGZkvOOgusC8jt2 syLfvMLDairtWGkTz/q9MGu/2A== X-Received: by 2002:a1c:8e8c:: with SMTP id q134-v6mr1700220wmd.3.1531496366286; Fri, 13 Jul 2018 08:39:26 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id 63-v6sm4840902wmo.22.2018.07.13.08.39.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jul 2018 08:39:25 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, lgirdwood@gmail.com, alsa-devel@alsa-project.org Cc: perex@perex.cz, tiwai@suse.com, vkoul@kernel.org, linux-kernel@vger.kernel.org, rohitkr@codeaurora.org, bgoswami@codeaurora.org, Srinivas Kandagatla Subject: [PATCH v2 5/5] ASoC: qcom: apq8096: remove component framework related code Date: Fri, 13 Jul 2018 16:36:32 +0100 Message-Id: <20180713153632.32511-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180713153632.32511-1-srinivas.kandagatla@linaro.org> References: <20180713153632.32511-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the component framework is integrated into the ASoC core, remove any redundant code in this driver. Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/apq8096.c | 75 ++++-------------------------------------------- 1 file changed, 6 insertions(+), 69 deletions(-) -- 2.16.2 diff --git a/sound/soc/qcom/apq8096.c b/sound/soc/qcom/apq8096.c index cab8c4ff7c00..a56156281c8d 100644 --- a/sound/soc/qcom/apq8096.c +++ b/sound/soc/qcom/apq8096.c @@ -129,17 +129,18 @@ static int apq8096_sbc_parse_of(struct snd_soc_card *card) return ret; } -static int apq8096_bind(struct device *dev) +static int apq8096_platform_probe(struct platform_device *pdev) { struct snd_soc_card *card; + struct device *dev = &pdev->dev; int ret; card = kzalloc(sizeof(*card), GFP_KERNEL); if (!card) return -ENOMEM; - component_bind_all(dev, card); card->dev = dev; + card->auto_bind = true; dev_set_drvdata(dev, card); ret = apq8096_sbc_parse_of(card); if (ret) { @@ -154,82 +155,18 @@ static int apq8096_bind(struct device *dev) return 0; err: - component_unbind_all(dev, card); kfree(card); return ret; } -static void apq8096_unbind(struct device *dev) +static int apq8096_platform_remove(struct platform_device *pdev) { - struct snd_soc_card *card = dev_get_drvdata(dev); + struct snd_soc_card *card = dev_get_drvdata(&pdev->dev); + card->auto_bind = false; snd_soc_unregister_card(card); - component_unbind_all(dev, card); kfree(card->dai_link); kfree(card); -} - -static const struct component_master_ops apq8096_ops = { - .bind = apq8096_bind, - .unbind = apq8096_unbind, -}; - -static int apq8016_compare_of(struct device *dev, void *data) -{ - return dev->of_node == data; -} - -static void apq8016_release_of(struct device *dev, void *data) -{ - of_node_put(data); -} - -static int add_audio_components(struct device *dev, - struct component_match **matchptr) -{ - struct device_node *np, *platform, *cpu, *node, *dai_node; - - node = dev->of_node; - - for_each_child_of_node(node, np) { - cpu = of_get_child_by_name(np, "cpu"); - if (cpu) { - dai_node = of_parse_phandle(cpu, "sound-dai", 0); - of_node_get(dai_node); - component_match_add_release(dev, matchptr, - apq8016_release_of, - apq8016_compare_of, - dai_node); - } - - platform = of_get_child_by_name(np, "platform"); - if (platform) { - dai_node = of_parse_phandle(platform, "sound-dai", 0); - component_match_add_release(dev, matchptr, - apq8016_release_of, - apq8016_compare_of, - dai_node); - } - } - - return 0; -} - -static int apq8096_platform_probe(struct platform_device *pdev) -{ - struct component_match *match = NULL; - int ret; - - ret = add_audio_components(&pdev->dev, &match); - if (ret) - return ret; - - return component_master_add_with_match(&pdev->dev, &apq8096_ops, match); -} - -static int apq8096_platform_remove(struct platform_device *pdev) -{ - component_master_del(&pdev->dev, &apq8096_ops); return 0; }