From patchwork Wed Aug 5 15:25:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej S. Szmigiero" X-Patchwork-Id: 6950871 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 96394C05AC for ; Wed, 5 Aug 2015 15:25:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6842203C3 for ; Wed, 5 Aug 2015 15:25:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9832B204C9 for ; Wed, 5 Aug 2015 15:25:54 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9E360266135; Wed, 5 Aug 2015 17:25:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id F3391265FC8; Wed, 5 Aug 2015 17:25:45 +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 BAD7026600E; Wed, 5 Aug 2015 17:25:44 +0200 (CEST) Received: from vps-vb.mhejs.net (vi37-28-154-113.vibiznes.pl [37.28.154.113]) by alsa0.perex.cz (Postfix) with ESMTP id 0D813265E3F for ; Wed, 5 Aug 2015 17:25:37 +0200 (CEST) Received: by vps-vb.mhejs.net with esmtps (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.82) (envelope-from ) id 1ZN0ZU-0001l4-QM; Wed, 05 Aug 2015 17:25:36 +0200 Message-ID: <55C22AEB.70809@maciej.szmigiero.name> Date: Wed, 05 Aug 2015 17:25:31 +0200 From: "Maciej S. Szmigiero" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: "alsa-devel@alsa-project.org" Cc: Timur Tabi , Xiubo Li , Takashi Iwai , linux-kernel , Liam Girdwood , Nicolin Chen , Mark Brown , Fabio Estevam , Markus Pargmann , linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH 4/6][RESEND] ASoC: fsl_ssi: add AC'97 ops setting check and cleanup 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Check whether setting AC'97 ops succeeded and clean them on removal so the fsl_ssi driver can be reloaded. Signed-off-by: Maciej Szmigiero --- This is a resend without changes, to keep the whole series together. sound/soc/fsl/fsl_ssi.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 7f4f0b9..154bcf6 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1340,7 +1340,11 @@ static int fsl_ssi_probe(struct platform_device *pdev) fsl_ac97_data = ssi_private; - snd_soc_set_ac97_ops_of_reset(&fsl_ssi_ac97_ops, pdev); + ret = snd_soc_set_ac97_ops_of_reset(&fsl_ssi_ac97_ops, pdev); + if (ret) { + dev_err(&pdev->dev, "could not set AC'97 ops\n"); + return ret; + } } else { /* Initialize this copy of the CPU DAI driver structure */ memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template, @@ -1480,6 +1484,9 @@ static int fsl_ssi_remove(struct platform_device *pdev) if (ssi_private->soc->imx) fsl_ssi_imx_clean(pdev, ssi_private); + if (fsl_ssi_is_ac97(ssi_private)) + snd_soc_set_ac97_ops(NULL); + return 0; }