Received: by 10.223.185.116 with SMTP id b49csp6371519wrg; Wed, 28 Feb 2018 08:19:29 -0800 (PST) X-Google-Smtp-Source: AG47ELuulXdMKj/+RXYrbVOq7FJCnFtgNJYt3GG3aQkhFIdS0wuVIsINGRogtPlcKeF4D/Xg49V5 X-Received: by 2002:a17:902:467:: with SMTP id 94-v6mr3316938ple.57.1519834769084; Wed, 28 Feb 2018 08:19:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519834769; cv=none; d=google.com; s=arc-20160816; b=ve+w3z77DeD9pVmME2Vw0yxd6F8WLRioIwLqqPvY+otIlwPIQfSfceGZDnknqpGBeL PL2y/p473eKVdfAr6KvIeFB0YImJb9TJNHermK9sLO1QyA3bDDKLRdWTSBTL8rEu58IX 1M0BERBwkxd76tGsZwsMvBj1wxbk7UG4UmVk46JoutY59/Rs81+srrF3d9dqOOSURCkd SBpu/YZSuryBcriset2zbh0smm4XpWL2qjPc7BdG2hGN8d35bYF2NoB/sTsnnpvczNVH sJH/pCU5j3J5Vbht/eMISK/XnXtazVYBrBKmw42WZmdmn0hlMaj8k2mgIQ3b07VRXKAH m9LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=/TYXvv1t3uys3i3ppEBogh91oWERLtfuidIWCYLGKuE=; b=ejcDpyOWJ+0gjF5ZVRFYO03s2CXG4sXgmfKVTvbqEr2Ww8Zvg1oYK6U28Nju3x2r61 XWZ/T5gquuZx6si5paiSP9KNoyF8GFV+lKikLo54ZRlBYOMqo2pFJqB4+wL+w02u74S/ tqk2N3c47pxLUklZKbeVMYjs8KeS/Bi/3RasETPkX4Fcd4H/YW/xHFHI8kSlXd/UhvIq 3Um84T2eTVEs4lTqiKFq3SOj7ckbey2F057MEjl9P+jQ6wINUXPF9oPtFxwe2y3jlkvA 7XvqN7A6xdwBxVd/b/AtBsZ/P0cV0zIDVYnH1FOTpJsu+481MRHFAknm4pNucoMhHdfL 5s7g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si1197415pgc.527.2018.02.28.08.19.14; Wed, 28 Feb 2018 08:19:29 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935049AbeB1QSD (ORCPT + 99 others); Wed, 28 Feb 2018 11:18:03 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35282 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932298AbeB1QSA (ORCPT ); Wed, 28 Feb 2018 11:18:00 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yv-0006XS-G9; Wed, 28 Feb 2018 15:22:33 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yd-0008NC-Aa; Wed, 28 Feb 2018 15:22:15 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Maciej S. Szmigiero" , "Nicolin Chen" , "Mark Brown" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 015/254] ASoC: fsl_ssi: AC'97 ops need regmap, clock and cleaning up on failure In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: "Maciej S. Szmigiero" commit 695b78b548d8a26288f041e907ff17758df9e1d5 upstream. AC'97 ops (register read / write) need SSI regmap and clock, so they have to be set after them. We also need to set these ops back to NULL if we fail the probe. Signed-off-by: Maciej S. Szmigiero Acked-by: Nicolin Chen Signed-off-by: Mark Brown [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- sound/soc/fsl/fsl_ssi.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1273,12 +1273,6 @@ static int fsl_ssi_probe(struct platform sizeof(fsl_ssi_ac97_dai)); fsl_ac97_data = ssi_private; - - 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, @@ -1336,6 +1330,14 @@ static int fsl_ssi_probe(struct platform goto error_irqmap; } + if (fsl_ssi_is_ac97(ssi_private)) { + 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"); + goto error_ac97_ops; + } + } + ret = snd_soc_register_component(&pdev->dev, &fsl_ssi_component, &ssi_private->cpu_dai_drv, 1); if (ret) { @@ -1400,6 +1402,10 @@ error_irq: snd_soc_unregister_component(&pdev->dev); error_asoc_register: + if (fsl_ssi_is_ac97(ssi_private)) + snd_soc_set_ac97_ops(NULL); + +error_ac97_ops: if (ssi_private->soc->imx) fsl_ssi_imx_clean(pdev, ssi_private);